Back to index

radiance  4R0+20100331
Public Member Functions | Public Attributes
py_tests.test_ttyimage.TtyimageTestCase Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_ttyimage

Public Attributes

 oldpath

Detailed Description

Definition at line 11 of file test_ttyimage.py.


Member Function Documentation

Definition at line 12 of file test_ttyimage.py.

00012 
00013        def setUp(self):
00014               self.oldpath = os.environ['PATH']
00015               os.environ['PATH'] = os.path.abspath(support.BINDIR)

Definition at line 16 of file test_ttyimage.py.

00016 
00017        def tearDown(self):
00018               os.environ['PATH'] = self.oldpath

We just do a few spot checks here

Definition at line 19 of file test_ttyimage.py.

00019 
00020        def test_ttyimage(self):
00021               '''We just do a few spot checks here'''
00022               picfile = support.datafile('Earth128.pic')
00023               cmd = 'ttyimage "%s"' % picfile
00024               res0 = os.popen(cmd).read()
00025               result = map(string.split,string.split(res0, '\n'))
00026               expect = [[0,
00027               ['################################################################'
00028                '################################################################']],
00029               [7,
00030               ['#########################@%,,.?++&%%###$&###############@&:.....'
00031                '.......,,.......,,.,,;..+?,...,.:*+.:&#########@################']],
00032               [23,
00033               ['.......;,:.....,++*+?++++;+;:,::,..,,;+;;+...................,;,'
00034                '..,:;+::+;;:;;:;;;;;:;+;;;;;;;;;:;+;;;;;%%$@%$&%#?.....,#%......']],
00035               [54,
00036               ['................................,,,.......................*%?$@#'
00037                '###########@$%%%;.........:?:.....,?+;:....;,...................']],
00038               [99,
00039               ['.....................................+++........................'
00040                '................................................................']],
00041                ]
00042 
00043               for l in expect:
00044                      self.assertEqual(result[l[0]], l[1],
00045                      '%s : %s != %s [line %s]' % (cmd,result[l[0]],l[1], l[0]))


Member Data Documentation

Definition at line 13 of file test_ttyimage.py.


The documentation for this class was generated from the following file: