|
12 | 12 | from compose.service import (
|
13 | 13 | APIError,
|
14 | 14 | ConfigError,
|
15 |
| - build_port_bindings, |
16 | 15 | build_volume_binding,
|
17 | 16 | get_container_data_volumes,
|
18 | 17 | get_container_name,
|
19 | 18 | merge_volume_bindings,
|
20 | 19 | parse_repository_tag,
|
21 | 20 | parse_volume_spec,
|
22 |
| - split_port, |
23 | 21 | )
|
24 | 22 |
|
25 | 23 |
|
@@ -111,48 +109,6 @@ def test_get_volumes_from_service_no_container(self):
|
111 | 109 | self.assertEqual(service._get_volumes_from(), [container_id])
|
112 | 110 | from_service.create_container.assert_called_once_with()
|
113 | 111 |
|
114 |
| - def test_split_port_with_host_ip(self): |
115 |
| - internal_port, external_port = split_port("127.0.0.1:1000:2000") |
116 |
| - self.assertEqual(internal_port, "2000") |
117 |
| - self.assertEqual(external_port, ("127.0.0.1", "1000")) |
118 |
| - |
119 |
| - def test_split_port_with_protocol(self): |
120 |
| - internal_port, external_port = split_port("127.0.0.1:1000:2000/udp") |
121 |
| - self.assertEqual(internal_port, "2000/udp") |
122 |
| - self.assertEqual(external_port, ("127.0.0.1", "1000")) |
123 |
| - |
124 |
| - def test_split_port_with_host_ip_no_port(self): |
125 |
| - internal_port, external_port = split_port("127.0.0.1::2000") |
126 |
| - self.assertEqual(internal_port, "2000") |
127 |
| - self.assertEqual(external_port, ("127.0.0.1", None)) |
128 |
| - |
129 |
| - def test_split_port_with_host_port(self): |
130 |
| - internal_port, external_port = split_port("1000:2000") |
131 |
| - self.assertEqual(internal_port, "2000") |
132 |
| - self.assertEqual(external_port, "1000") |
133 |
| - |
134 |
| - def test_split_port_no_host_port(self): |
135 |
| - internal_port, external_port = split_port("2000") |
136 |
| - self.assertEqual(internal_port, "2000") |
137 |
| - self.assertEqual(external_port, None) |
138 |
| - |
139 |
| - def test_split_port_invalid(self): |
140 |
| - with self.assertRaises(ConfigError): |
141 |
| - split_port("0.0.0.0:1000:2000:tcp") |
142 |
| - |
143 |
| - def test_build_port_bindings_with_one_port(self): |
144 |
| - port_bindings = build_port_bindings(["127.0.0.1:1000:1000"]) |
145 |
| - self.assertEqual(port_bindings["1000"], [("127.0.0.1", "1000")]) |
146 |
| - |
147 |
| - def test_build_port_bindings_with_matching_internal_ports(self): |
148 |
| - port_bindings = build_port_bindings(["127.0.0.1:1000:1000", "127.0.0.1:2000:1000"]) |
149 |
| - self.assertEqual(port_bindings["1000"], [("127.0.0.1", "1000"), ("127.0.0.1", "2000")]) |
150 |
| - |
151 |
| - def test_build_port_bindings_with_nonmatching_internal_ports(self): |
152 |
| - port_bindings = build_port_bindings(["127.0.0.1:1000:1000", "127.0.0.1:2000:2000"]) |
153 |
| - self.assertEqual(port_bindings["1000"], [("127.0.0.1", "1000")]) |
154 |
| - self.assertEqual(port_bindings["2000"], [("127.0.0.1", "2000")]) |
155 |
| - |
156 | 112 | def test_split_domainname_none(self):
|
157 | 113 | service = Service('foo', image='foo', hostname='name', client=self.mock_client)
|
158 | 114 | self.mock_client.containers.return_value = []
|
|
0 commit comments