def test_absent_route_object_as_dict(self): route = _create_route_dict("198.51.100.0/24", "192.0.2.1", "eth1", 50, 103) route[Route.STATE] = Route.STATE_ABSENT route_obj = RouteEntry(route) assert route_obj.absent assert route_obj.to_dict() == route
def test_absent_route_with_missing_props_as_dict(self, route_property): absent_route = _create_route_dict("198.51.100.0/24", "192.0.2.1", "eth1", 50, 103) absent_route[Route.STATE] = Route.STATE_ABSENT del absent_route[route_property] route_obj = RouteEntry(absent_route) assert route_obj.to_dict() == absent_route
def test_normal_route_object_as_dict(self): route = _create_route_dict("198.51.100.0/24", "192.0.2.1", "eth1", 50, 103) route_obj = RouteEntry(route) assert route_obj.to_dict() == route