Skip to content

Commit e609247

Browse files
committed
TST: cover PhaseConfigurePanel.popupMenu
1 parent 0fc384f commit e609247

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/diffpy/pdfgui/tests/testphaseconfigurepanel.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from diffpy.pdfgui.gui.phaseconfigurepanel import PhaseConfigurePanel
2525
from diffpy.pdfgui.gui.mainframe import MainFrame
2626
from diffpy.pdfgui.tests.testutils import GUITestCase, datafile, tooltiptext
27+
from diffpy.pdfgui.tests.testutils import clickcell
2728

2829
# ----------------------------------------------------------------------------
2930

@@ -67,6 +68,19 @@ def test_restrictConstrainedParameters(self):
6768
self.assertEqual('@1', tooltiptext(panel.textCtrlA))
6869
return
6970

71+
72+
def test_onCellRightClick(self):
73+
"check right-click handling over the atoms grid."
74+
# disable modal gridAtoms.PopupMenu
75+
ga = self.panel.gridAtoms
76+
ga.PopupMenu = lambda menu, pos: None
77+
try:
78+
clickcell(ga, "right", 0, 1)
79+
finally:
80+
del ga.PopupMenu
81+
self.assertIsNotNone(self.panel.insertID)
82+
return
83+
7084
# End of class TestPhaseConfigurePanel
7185

7286
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)