def test_assign_sg_params_from_port_bigger_than_to_port(self): with self.assertRaises(AssertionError) as context: assign_sg_params(MockedData.sg_invalid) self.assertTrue( 'Invalid configuration from_port can not be bigger than to_port.' in context.exception)
def test_assign_sg_params_no_data_given_in_rules(self): self.assertEqual(MockedData.sg_params_all_port_no_ip, assign_sg_params(MockedData.sg_all_port_no_ip))
def test_assign_sg_params_one_port_two_cidrs_any_proto(self): self.assertEqual( MockedData.sg_params_ssh_with_2_cidrs_any_proto, assign_sg_params(MockedData.sg_ssh_with_2_cidrs_any_proto))
def test_assign_sg_params_all_ports_with_all_ips(self): self.assertEqual(MockedData.sg_params_all_port_all_ip, assign_sg_params(MockedData.sg_all_port_all_ip))
def test_assign_sg_params_one_port_with_two_cidrs(self): self.assertEqual(MockedData.sg_params_ssh_with_2_cidrs, assign_sg_params(MockedData.sg_ssh_with_2_cidrs))