ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/test/py_tests/test_xform.py
Revision: 1.1
Committed: Sun Dec 7 20:40:51 2003 UTC (20 years, 4 months ago) by schorsch
Content type: text/x-python
Branch: MAIN
CVS Tags: rad3R7P2, rad4R2P2, rad4R2P1, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9, rad5R0
Log Message:
First attempt at testing framework.

File Contents

# User Rev Content
1 schorsch 1.1
2     import os
3     import math
4     import string
5     import unittest
6    
7     from unit_tools import support
8     from unit_tools import lcompare
9    
10     class XformTestCase(unittest.TestCase):
11     def setUp(self):
12     self.oldpath = os.environ['PATH']
13     os.environ['PATH'] = os.path.abspath(support.BINDIR)
14    
15     def tearDown(self):
16     os.environ['PATH'] = self.oldpath
17    
18     def test_xform(self):
19     cmd = 'xform -e -s 3.14159 "%s"' % support.datafile('xform_1.dat')
20     result = lcompare.split_rad(os.popen(cmd).read())
21     expect = lcompare.split_radfile(support.datafile('xform_res1.dat'))
22     try: lcompare.llcompare(result, expect, ignore_empty=1)
23     except lcompare.error, e:
24     self.fail('%s [%s]' % (str(e),cmd))
25    
26    
27     def test_xform(self):
28     cmd = 'xform -e -mx "%s"' % support.datafile('xform_2.dat')
29     result = lcompare.split_rad(os.popen(cmd).read())
30     expect = lcompare.split_radfile(support.datafile('xform_res2.dat'))
31     try: lcompare.llcompare(result, expect, ignore_empty=1)
32     except lcompare.error, e:
33     self.fail('%s [%s]' % (str(e),cmd))
34    
35     def main():
36     support.run_case(XformTestCase)
37    
38     if __name__ == '__main__':
39     main()
40    
41     # vi: set ts=4 sw=4 :