File: PYMOL-2701.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 (20 lines) | stat: -rw-r--r-- 610 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'''
mol2 formal charge assigment (import)
'''

from pymol import cmd, CmdException, testing, stored

class TestPYMOL2701(testing.PyMOLTestCase):

    @testing.requires_version('1.8.0.4')
    def testMol2FormalChargeAssignment(self):
        cmd.fragment('lys')
        cmd.fragment('lys')

        with testing.mktemp('.mol2') as filename:
            cmd.save(filename, state=0)
            cmd.delete('*')
            cmd.load(filename)

        self.assertEqual(cmd.get_model('name NZ', state=1).atom[0].formal_charge, 1)
        self.assertEqual(cmd.get_model('name NZ', state=2).atom[0].formal_charge, 1)