def build(self): if self.config['validate_swagger_spec']: validator20.validate_spec(self.spec_dict) self.api_url = build_api_serving_url(self.spec_dict, self.origin_url) self.definitions = build_models(self.spec_dict.get('definitions', {})) self.resources = build_resources(self)
def test_not_empty(definitions_spec): models = build_models(definitions_spec) for model_name in definitions_spec.keys(): model_type = models.get(model_name) assert model_name == model_type.__name__ assert isinstance(model_type, type)
def test_empty(): assert {} == build_models({})