7 |
|
from unit_tools import support |
8 |
|
from unit_tools import lcompare |
9 |
|
|
10 |
+ |
_bindir = None |
11 |
+ |
|
12 |
|
class XformTestCase(unittest.TestCase): |
13 |
|
def setUp(self): |
14 |
< |
self.oldpath = os.environ['PATH'] |
15 |
< |
os.environ['PATH'] = os.path.abspath(support.BINDIR) |
14 |
> |
if _bindir: |
15 |
> |
self.oldpath = os.environ['PATH'] |
16 |
> |
os.environ['PATH'] = _bindir |
17 |
|
|
18 |
|
def tearDown(self): |
19 |
< |
os.environ['PATH'] = self.oldpath |
19 |
> |
if _bindir: |
20 |
> |
os.environ['PATH'] = self.oldpath |
21 |
|
|
22 |
< |
def test_xform(self): |
22 |
> |
def test_xform_e_s(self): |
23 |
|
cmd = 'xform -e -s 3.14159 "%s"' % support.datafile('xform_1.dat') |
24 |
|
result = lcompare.split_rad(os.popen(cmd).read()) |
25 |
|
expect = lcompare.split_radfile(support.datafile('xform_res1.dat')) |
28 |
|
self.fail('%s [%s]' % (str(e),cmd)) |
29 |
|
|
30 |
|
|
31 |
< |
def test_xform(self): |
31 |
> |
def test_xform_e_mx(self): |
32 |
|
cmd = 'xform -e -mx "%s"' % support.datafile('xform_2.dat') |
33 |
|
result = lcompare.split_rad(os.popen(cmd).read()) |
34 |
|
expect = lcompare.split_radfile(support.datafile('xform_res2.dat')) |
36 |
|
except lcompare.error, e: |
37 |
|
self.fail('%s [%s]' % (str(e),cmd)) |
38 |
|
|
39 |
< |
def main(): |
39 |
> |
def main(bindir=None): |
40 |
> |
global _bindir |
41 |
> |
_bindir=bindir |
42 |
|
support.run_case(XformTestCase) |
43 |
|
|
44 |
|
if __name__ == '__main__': |