mirror of https://github.com/docker/compose.git
Fix ports validation test
We were essentially only testing that *at least one* of the invalid values fails the validation check, rather than that *all* of them fail. Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
7b893164a4
commit
b85bfce65e
|
@ -264,9 +264,8 @@ class ConfigTest(unittest.TestCase):
|
|||
assert services[0]['name'] == valid_name
|
||||
|
||||
def test_config_invalid_ports_format_validation(self):
|
||||
expected_error_msg = "Service 'web' configuration key 'ports' contains an invalid type"
|
||||
with self.assertRaisesRegexp(ConfigurationError, expected_error_msg):
|
||||
for invalid_ports in [{"1": "8000"}, False, 0, "8000", 8000, ["8000", "8000"]]:
|
||||
for invalid_ports in [{"1": "8000"}, False, 0, "8000", 8000, ["8000", "8000"]]:
|
||||
with pytest.raises(ConfigurationError):
|
||||
config.load(
|
||||
build_config_details(
|
||||
{'web': {'image': 'busybox', 'ports': invalid_ports}},
|
||||
|
|
Loading…
Reference in New Issue