6 |
|
from unit_tools import support |
7 |
|
from unit_tools import lcompare |
8 |
|
|
9 |
+ |
_bindir = None |
10 |
+ |
|
11 |
|
class HistoTestCase(unittest.TestCase): |
12 |
|
def setUp(self): |
13 |
< |
self.oldpath = os.environ['PATH'] |
14 |
< |
os.environ['PATH'] = os.path.abspath(support.BINDIR) |
13 |
> |
if _bindir: |
14 |
> |
self.oldpath = os.environ['PATH'] |
15 |
> |
os.environ['PATH'] = _bindir |
16 |
|
|
17 |
|
def tearDown(self): |
18 |
< |
os.environ['PATH'] = self.oldpath |
18 |
> |
if _bindir: |
19 |
> |
os.environ['PATH'] = self.oldpath |
20 |
|
|
21 |
|
def test_histo(self): |
22 |
|
cmd = 'histo -0.5 8.5 9 < "%s"' % support.datafile('histo.dat') |
96 |
|
except lcompare.error, e: |
97 |
|
self.fail('%s [%s]' % (str(e),cmd)) |
98 |
|
|
99 |
< |
def main(): |
99 |
> |
def main(bindir=None): |
100 |
> |
global _bindir |
101 |
> |
_bindir=bindir |
102 |
|
support.run_case(HistoTestCase) |
103 |
|
|
104 |
|
if __name__ == '__main__': |