| 8 |
|
from unit_tools import support |
| 9 |
|
from unit_tools import lcompare |
| 10 |
|
|
| 11 |
+ |
_bindir = None |
| 12 |
+ |
|
| 13 |
|
class TtyimageTestCase(unittest.TestCase): |
| 14 |
|
def setUp(self): |
| 15 |
< |
self.oldpath = os.environ['PATH'] |
| 16 |
< |
os.environ['PATH'] = os.path.abspath(support.BINDIR) |
| 15 |
> |
if _bindir: |
| 16 |
> |
self.oldpath = os.environ['PATH'] |
| 17 |
> |
os.environ['PATH'] = _bindir |
| 18 |
|
|
| 19 |
|
def tearDown(self): |
| 20 |
< |
os.environ['PATH'] = self.oldpath |
| 20 |
> |
if _bindir: |
| 21 |
> |
os.environ['PATH'] = self.oldpath |
| 22 |
|
|
| 23 |
|
def test_ttyimage(self): |
| 24 |
< |
'''We just to point checks here''' |
| 24 |
> |
'''We just do a few spot checks here''' |
| 25 |
|
picfile = support.datafile('Earth128.pic') |
| 26 |
|
cmd = 'ttyimage "%s"' % picfile |
| 27 |
|
res0 = os.popen(cmd).read() |
| 47 |
|
self.assertEqual(result[l[0]], l[1], |
| 48 |
|
'%s : %s != %s [line %s]' % (cmd,result[l[0]],l[1], l[0])) |
| 49 |
|
|
| 50 |
< |
def main(): |
| 50 |
> |
def main(bindir=None): |
| 51 |
> |
global _bindir |
| 52 |
> |
_bindir=bindir |
| 53 |
|
support.run_case(TtyimageTestCase) |
| 54 |
|
|
| 55 |
|
if __name__ == '__main__': |