ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/test/py_tests/test_lam.py
Revision: 1.2
Committed: Thu Feb 10 16:36:54 2005 UTC (19 years, 2 months ago) by schorsch
Content type: text/x-python
Branch: MAIN
CVS Tags: rad3R7P2, rad4R2P2, rad4R2P1, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R8, rad3R9, rad5R0
Changes since 1.1: +1 -1 lines
Log Message:
Updated for changed executable names.

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 LamTestCase(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_lam(self):
19     dat_de = support.datafile('lam_de.dat')
20     dat_en = support.datafile('lam_en.dat')
21 schorsch 1.2 cmd = 'rlam -t: "%s" "%s"' % (dat_de, dat_en)
22 schorsch 1.1 raw = os.popen(cmd).read()
23     result = map(string.split,string.split(raw,'\n'))
24     expect = [
25     ['eins:one'],
26     ['zwei:two'],
27     ['drei:three'],
28     ['vier:four'],
29     ['fuenf:five'],
30     ]
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(LamTestCase)
37    
38     if __name__ == '__main__':
39     main()
40    
41     # vi: set ts=4 sw=4 :