From 66613f4112b0e68f30430944b7d94e6ca14b1f62 Mon Sep 17 00:00:00 2001 From: Michael Hwang Date: Thu, 14 Sep 2017 10:56:07 -0400 Subject: Fix issue where container ports is not list Container ports was being returned as dict keys for python3 Change-Id: I434049c465094265d8e0ec8c8d6310b682866da8 Issue-Id: DCAEGEN2-91 Signed-off-by: Michael Hwang --- python-dockering/tests/test_config_building.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'python-dockering/tests/test_config_building.py') diff --git a/python-dockering/tests/test_config_building.py b/python-dockering/tests/test_config_building.py index c9251e2..ff1b409 100644 --- a/python-dockering/tests/test_config_building.py +++ b/python-dockering/tests/test_config_building.py @@ -148,3 +148,11 @@ def test_parse_volumes_param(): assert actual == expected assert None == doc._parse_volumes_param(None) + + +def test_get_container_ports(): + hcp = {'publish_all_ports': False, 'port_bindings': {'80': {'HostPort': + '80'}, '22': {'HostPort': '22'}}} + assert sorted(['80', '22']) == sorted(doc._get_container_ports(hcp)) + + assert None == doc._get_container_ports({}) -- cgit 1.2.3-korg