summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlises Reyes <ulises@datarobot.com>2013-12-14 22:24:19 -0500
committerUlises Reyes <ulises@datarobot.com>2013-12-14 22:24:19 -0500
commita7c1449757bb471eb86291295cf206dcc55c1b78 (patch)
tree707448d81881bc23c119ed8b15838eaf8be717c4
parentf5924c386384dec09c69c34f08bba4dd08736109 (diff)
downloaddocker-py-a7c1449757bb471eb86291295cf206dcc55c1b78.tar.gz
Improved assertions in the port test
-rw-r--r--tests/integration_test.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/integration_test.py b/tests/integration_test.py
index 8461483..694005b 100644
--- a/tests/integration_test.py
+++ b/tests/integration_test.py
@@ -402,20 +402,25 @@ class TestKillWithSignal(BaseTestCase):
self.assertIn('Running', state)
self.assertEqual(state['Running'], False, state)
+
class TestPort(BaseTestCase):
def runTest(self):
container = self.client.create_container('busybox', ['sleep', '9999'], ports=[1111, 2222])
id = container['Id']
- self.client.start(container, port_bindings={1111: ('127.0.0.1', 4567)})
+ self.client.start(container, port_bindings={
+ 1111: ('127.0.0.1', 4567),
+ })
port_bindings = self.client.port(container, 1111)
self.assertIsInstance(port_bindings, list)
self.assertEqual(len(port_bindings), 1)
+ print port_bindings
port_binding = port_bindings.pop()
self.assertIn('HostPort', port_binding)
self.assertIn('HostIp', port_binding)
- self.assertTrue(port_binding['HostPort'])
+ self.assertEqual(port_binding['HostPort'], '4567')
+ self.assertEqual(port_binding['HostIp'], '127.0.0.1')
self.client.kill(id)