2018-10-26 08:14:39 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
import mitogen
|
|
|
|
|
|
|
|
import unittest2
|
|
|
|
|
|
|
|
import testlib
|
|
|
|
|
|
|
|
|
2018-11-03 13:28:37 +00:00
|
|
|
class ConstructorTest(testlib.RouterMixin, testlib.TestCase):
|
2018-10-26 08:14:39 +00:00
|
|
|
def test_okay(self):
|
2018-10-31 00:05:21 +00:00
|
|
|
docker_path = testlib.data_path('stubs/stub-docker.py')
|
2018-10-26 08:14:39 +00:00
|
|
|
context = self.router.docker(
|
|
|
|
container='container_name',
|
|
|
|
docker_path=docker_path,
|
|
|
|
)
|
|
|
|
stream = self.router.stream_by_id(context.context_id)
|
|
|
|
|
|
|
|
argv = eval(context.call(os.getenv, 'ORIGINAL_ARGV'))
|
|
|
|
self.assertEquals(argv[0], docker_path)
|
|
|
|
self.assertEquals(argv[1], 'exec')
|
|
|
|
self.assertEquals(argv[2], '--interactive')
|
|
|
|
self.assertEquals(argv[3], 'container_name')
|
|
|
|
self.assertEquals(argv[4], stream.python_path)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest2.main()
|