| 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 : |