File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ import os
2+
3+ import mitogen
4+
5+ import unittest2
6+
7+ import testlib
8+
9+
10+ class ConstructorTest (testlib .RouterMixin , testlib .TestCase ):
11+ def test_okay (self ):
12+ buildah_path = testlib .data_path ('stubs/stub-buildah.py' )
13+ context = self .router .buildah (
14+ container = 'container_name' ,
15+ buildah_path = buildah_path ,
16+ )
17+ stream = self .router .stream_by_id (context .context_id )
18+
19+ argv = eval (context .call (os .getenv , 'ORIGINAL_ARGV' ))
20+ self .assertEquals (argv [0 ], buildah_path )
21+ self .assertEquals (argv [1 ], 'run' )
22+ self .assertEquals (argv [2 ], '--' )
23+ self .assertEquals (argv [3 ], 'container_name' )
24+ self .assertEquals (argv [4 ], stream .python_path )
25+
26+
27+ if __name__ == '__main__' :
28+ unittest2 .main ()
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ import sys
4+ import os
5+
6+ os .environ ['ORIGINAL_ARGV' ] = repr (sys .argv )
7+ os .environ ['THIS_IS_STUB_BUILDAH' ] = '1'
8+ os .execv (sys .executable , sys .argv [sys .argv .index ('--' ) + 2 :])
You can’t perform that action at this time.
0 commit comments