def test_make_it(self): sot = route.Route(**EXAMPLE) self.assertEqual(EXAMPLE['id'], sot.id) self.assertEqual(EXAMPLE['destination'], sot.destination) self.assertEqual(EXAMPLE['nexthop'], sot.nexthop) self.assertEqual(EXAMPLE['type'], sot.type) self.assertEqual(EXAMPLE['vpc_id'], sot.router_id) self.assertEqual(EXAMPLE['tenant_id'], sot.project_id)
def test_basic(self): sot = route.Route() self.assertEqual('route', sot.resource_key) self.assertEqual('routes', sot.resources_key) path = '/vpc/routes' self.assertEqual(path, sot.base_path) self.assertTrue(sot.allow_list) self.assertTrue(sot.allow_create) self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_delete) self.assertFalse(sot.allow_commit)
def generate(cls): """Create a fake VPC route. :return: A FakeResource object, with id, name and so on """ # Set default attributes. object_info = { "id": "id-" + uuid.uuid4().hex, "type": "peering", "nexthop": uuid.uuid4().hex, "router_id": uuid.uuid4().hex, "project_id": uuid.uuid4().hex, "destination": "192.168.200.0/24", } return route.Route(**object_info)