def test_segmentation_id_is_nothing(self): self.net.network_segments[0]["segmentation_id"] = None network_type, vlan_id = fj_util.get_network_segments(self.net) self.assertEqual('vlan', network_type) self.assertIsNone(vlan_id)
def test_network_type_is_not_vlan(self): self.net.network_segments[0]["network_type"] = "vxlan" network_type, vlan_id = fj_util.get_network_segments(self.net) self.assertEqual('vxlan', network_type) self.assertEqual(100, vlan_id)
def test_normal_case(self): network_type, vlan_id = fj_util.get_network_segments(self.net) self.assertEqual("vlan", network_type) self.assertEqual(100, vlan_id)