1 #!/usr/bin/env python2.2
4 from StringIO
import StringIO
5 sys
.path
.append('../../python')
7 if os
.environ
.has_key('ROXLIB_TEST_SUB'):
9 for arg
in sys
.argv
[1:]:
12 os
.environ
['ROXLIB_TEST_SUB'] = 'YES'
14 from rox
import processes
16 class TestROX(unittest
.TestCase
):
17 def try_with_args(self
, args
):
19 ptc
= processes
.PipeThroughCommand(
20 ['./testrox.py'] + args
, None, result
)
22 return result
.getvalue()
25 self
.assertEquals('', self
.try_with_args([]))
28 self
.assertEquals('-\n', self
.try_with_args(['-']))
31 self
.assertEquals('hello\nworld\n',
32 self
.try_with_args(['hello', 'world']))
35 self
.assertEquals('world\n-\n',
36 self
.try_with_args(['--g-fatal-warnings',
39 suite
= unittest
.makeSuite(TestROX
)
40 if __name__
== '__main__':