File: PYMOL-757.py

package info (click to toggle)
pymol 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 74,084 kB
  • sloc: cpp: 482,660; python: 89,328; ansic: 29,512; javascript: 6,792; sh: 84; makefile: 25
file content (28 lines) | stat: -rw-r--r-- 676 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'''
Regression test for PYMOL-757
Certain mouse actions in edit mode cause objects to be ungrouped
'''

from pymol import cmd, testing
from pymol.wizard import Wizard

class MockWizard(Wizard):
    def get_event_mask(self):
        return Wizard.event_mask_dirty
    def do_dirty(self):
        cmd.select('s1', 'none')
        cmd.delete('s1')

class Test757(testing.PyMOLTestCase):

    @testing.requires('gui')
    def testDirtyDelete(self):
        cmd.pseudoatom('m1')
        cmd.pseudoatom('m2')
        cmd.group('g1', 'm1 m2')
        cmd.set_wizard(MockWizard())

        cmd.draw()

        v = cmd.get_object_list('(g1)')
        self.assertEqual(v, ['m1', 'm2'])