File: test_grid3DCommands.py

package info (click to toggle)
mgltools-viewerframework 1.5.7-1
  • links: PTS, VCS
  • area: non-free
  • in suites: stretch
  • size: 1,584 kB
  • ctags: 1,271
  • sloc: python: 13,681; sh: 78; makefile: 10
file content (69 lines) | stat: -rw-r--r-- 2,146 bytes parent folder | download | duplicates (4)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#$Header: /opt/cvs/python/packages/share1.5/ViewerFramework/Tests/test_grid3DCommands.py,v 1.3 2010/05/26 23:27:59 annao Exp $
#
#$Id: test_grid3DCommands.py,v 1.3 2010/05/26 23:27:59 annao Exp $
import unittest, sys, os, time

from ViewerFramework.VF import ViewerFramework
ct = 0
totalCt = 8
vf = None

class Grid3DTest(unittest.TestCase):
    """Base class for grid3DCommands unittest"""

    def setUp(self):
        global vf
        if not vf:
            #print "creating vf"
            vf = self.vf = ViewerFramework(withShell=0)
        else:
            self.vf = vf
            
    def tearDown(self):
        global ct
        ct = ct + 1
        if ct == totalCt: self.vf.Exit(0)    
               
    def test_Grid3DCommands_1show_hide(self):
        """Tests if we can call show/hide methods of Grid3DCommands"""
        self.vf.Grid3DCommands.show()
        self.vf.Grid3DCommands.hide()
        

    def test_Grid3DCommands_2read(self):
        """Tests read method"""
        self.vf.Grid3DReadAny(os.path.join('Data', 'small.C.map'))

    def test_Grid3DCommands_3select(self):
        """Tests select methods"""
        self.vf.Grid3DCommands.mlb.selection_set('end')
        
    def test_Grid3DCommands_4_Isocontour(self):
        """Tests add Isocontour"""
        self.x = 10 #addBar expects event with x attribute
        self.vf.Grid3DCommands.Isocontour()
        self.vf.Grid3DIsocontour.ifd[0]['widget'].addBar(self)

    def test_Grid3DCommands_5_OrthoSlice(self):
        """Tests OrthoSlice"""
        self.vf.Grid3DCommands.OrthoSlice()

    def test_Grid3DCommands_6_VolRender(self):
        """Tests VolRender"""
        if self.vf.Grid3DCommands.Checkbuttons.has_key('VolRen'):
            self.vf.Grid3DCommands.VolRen()
        else:
            print "Volume Renderer is not tested "

    def test_Grid3DCommands_7_Isocontour(self):
        """Tests back to Isocontour"""
        self.vf.Grid3DCommands.Isocontour()
        
    def test_Grid3DCommands_8_remove(self):
        """Tests remove method"""
        self.vf.Grid3DAddRemove.remove()

if __name__ == '__main__':
        unittest.main()