def create_router(self, request, body): """Create a new router""" router = Router(self, body) yield router.validate_config() router.start(self.service) yield router.save() returnValue(response( request, 'router created', (yield router.status()), code=http.CREATED ))
def test_status(self): """status should return the current config of the router""" config = self.create_router_config() router = Router(self.api, config) status = yield router.status() self.assertEqual(status, router.router_config)