示例#1
0
 def test_mk_vpc_config_missing_security_groups(self, prj):
     prj.train["vpc_config"] = {"subnets": ["a"]}
     with pytest.raises(ConfigError) as err:
         cli_utils.mk_vpc_config(prj.train)
     assert str(err.value) == (
         "The vpc_config requires a dictionary with keys 'security_groups' and"
         " 'subnets'. Both the security_groups and subnets should contain lists"
         " of IDs.")
示例#2
0
 def test_mk_vpc_config_no_config(self, prj):
     assert cli_utils.mk_vpc_config(prj.train) is None
     assert cli_utils.mk_vpc_config(prj.deploy) is None
示例#3
0
 def test_mk_vpc_config_valid_config(self, prj):
     prj.train["vpc_config"] = {"security_groups": ["a"], "subnets": ["b"]}
     assert cli_utils.mk_vpc_config(prj.train) == {
         "SecurityGroupIds": ["a"],
         "Subnets": ["b"],
     }
示例#4
0
 def test_mk_vpc_config_empty_subnets(self, prj):
     prj.train["vpc_config"] = {"security_groups": ["a"], "subnets": []}
     with pytest.raises(ConfigError) as err:
         cli_utils.mk_vpc_config(prj.train)
     assert str(err.value) == (
         "The vpc_config must contain at least one subnet id.")