def test_segmentation_id_type(self): test_device = [{"device_name": "switch1", "interfaces": [{'name': "i1", 'segmentation_id': '67'}]}] ret_msg = l2gw_validators.validate_gwdevice_list(test_device) msg = "segmentation_id type should be of list type " self.assertEqual(msg, ret_msg)
def test_segmentation_id_type(self): test_device = [{"device_name": "switch1", "interfaces": [{'name': "i1", 'segmentation_id': '67'}]}] ret_msg = l2gw_validators.validate_gwdevice_list(test_device) msg = "segmentation_id type should be of list type " self.assertEqual(msg, ret_msg)
def test_segmentation_id_in_interface(self): test_device = [{"device_name": "switch1", "interfaces": [{'name': "i1", 'segmentation_id': ''}]}] ret_msg = l2gw_validators.validate_gwdevice_list(test_device) msg = "segmentation_id_list should not be empty" self.assertEqual(msg, ret_msg)
def test_for_empty_interface_name(self): test_device = [{"device_name": "switch1", "interfaces": [{'name': ""}]}] ret_msg = l2gw_validators.validate_gwdevice_list(test_device) msg = "Cannot create a gateway with an empty interface name" self.assertEqual(msg, ret_msg)
def test_for_interface_type_dict(self): test_device = [{"device_name": "switch1", "interfaces": ["port"]}] ret_msg = l2gw_validators.validate_gwdevice_list(test_device) msg = "interfaces format is not a type dict" self.assertEqual(msg, ret_msg)
def test_for_empty_device_name(self): test_device = [{"interfaces": "port"}] ret_msg = l2gw_validators.validate_gwdevice_list(test_device) msg = "Cannot create a gateway with an empty device_name" self.assertEqual(msg, ret_msg)
def test_validate_gwdevice_list(self): ret_msg = l2gw_validators.validate_gwdevice_list(None) msg = "Cannot create a gateway with an empty device list" self.assertEqual(msg, ret_msg)
def test_segmentation_id_in_interface(self): test_device = [{"device_name": "switch1", "interfaces": [{'name': "i1", 'segmentation_id': ''}]}] ret_msg = l2gw_validators.validate_gwdevice_list(test_device) msg = "segmentation_id_list should not be empty" self.assertEqual(msg, ret_msg)
def test_for_empty_interface_name(self): test_device = [{"device_name": "switch1", "interfaces": [{'name': ""}]}] ret_msg = l2gw_validators.validate_gwdevice_list(test_device) msg = "Cannot create a gateway with an empty interface name" self.assertEqual(msg, ret_msg)
def test_for_interface_type_dict(self): test_device = [{"device_name": "switch1", "interfaces": ["port"]}] ret_msg = l2gw_validators.validate_gwdevice_list(test_device) msg = "interfaces format is not a type dict" self.assertEqual(msg, ret_msg)
def test_for_empty_device_name(self): test_device = [{"interfaces": "port"}] ret_msg = l2gw_validators.validate_gwdevice_list(test_device) msg = "Cannot create a gateway with an empty device_name" self.assertEqual(msg, ret_msg)
def test_validate_gwdevice_list(self): ret_msg = l2gw_validators.validate_gwdevice_list(None) msg = "Cannot create a gateway with an empty device list" self.assertEqual(msg, ret_msg)