File: PYMOL-829.py

package info (click to toggle)
pymol 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 74,084 kB
  • sloc: cpp: 482,660; python: 89,328; ansic: 29,512; javascript: 6,792; sh: 84; makefile: 25
file content (39 lines) | stat: -rw-r--r-- 1,251 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
29
30
31
32
33
34
35
36
37
38
39
'''
Regression test for PYMOL-829
setting angle_color does not invalidate existing angles that should get color changed
'''

import unittest
from pymol import cmd, testing

@testing.requires('gui')
class Test829(testing.PyMOLTestCase):

    def testAngleColor(self):
        cmd.fragment('ala')
        cmd.color('blue')
        cmd.angle('ang01', 'index 8', 'index 5', 'index 2')
        cmd.hide('label')
        cmd.set('fog', '0')
        cmd.set('ambient', '1')
        cmd.set('angle_color', 'red')
        cmd.set('dash_gap', '0')
        cmd.zoom()
        #need to check to make sure screen image has red in it
        img_array = self.get_imagearray(width=100, height=100, ray=0)
        self.assertImageHasColor('red', img_array, delta=[10,0,0])

    def testDihedralColor(self):
        cmd.fragment('ala')
        cmd.color('blue')
        cmd.dihedral('dih01', 'index 8', 'index 5', 'index 2', 'index 1')
        cmd.hide('label')
        cmd.set('fog', '0')
        cmd.set('ambient', '1')
        cmd.set('dihedral_color', 'red')
        cmd.zoom()

        #need to check to make sure screen image has red in it
        img_array = self.get_imagearray(width=100, height=100, ray=0)
        self.assertImageHasColor('red', img_array)