def test_convert(self): self.maxDiff = None source = RESOURCES_DIR + "/swagger/petstore.json" result = self._get_tmp() options = FakeOptions(file_name=result) process(options, [source]) actual = yaml.load(open(result).read()) expected = yaml.load(open(RESOURCES_DIR + "/swagger/petstore-converted.yaml").read()) self.assertEqual(actual, expected)
def test_convert_security_apikey_query(self): source = RESOURCES_DIR + "/swagger/auth-key-as-param.json" expected = RESOURCES_DIR + "/swagger/auth-key-as-param-converted.yaml" result = self._get_tmp() options = FakeOptions(file_name=result) process(options, [source]) # shutil.copy(result, expected) actual = yaml.full_load(open(result).read()) expected = yaml.full_load(open(expected).read()) self.assertEqual(actual, expected)
def test_convert_scenarios_from_paths(self): source = RESOURCES_DIR + "/swagger/bzm-api.json" expected = RESOURCES_DIR + "/swagger/bzm-api-converted.yaml" result = self._get_tmp() options = FakeOptions(file_name=result, scenarios_from_paths=True) process(options, [source]) # shutil.copy(result, expected) actual = yaml.full_load(open(result).read()) expected = yaml.full_load(open(expected).read()) self.assertEqual(actual, expected)
def test_convert(self): source = RESOURCES_DIR + "/swagger/petstore.json" expected = RESOURCES_DIR + "/swagger/petstore-converted.yaml" result = self._get_tmp() options = FakeOptions(file_name=result) process(options, [source]) # shutil.copy(result, expected) actual = yaml.full_load(open(result).read()) expected = yaml.full_load(open(expected).read()) self.assertEqual(actual, expected)
def test_convert_interpolation_values(self): source = RESOURCES_DIR + "/swagger/bzm-api.json" expected = RESOURCES_DIR + "/swagger/bzm-converted-values.yaml" result = self._get_tmp() options = FakeOptions(file_name=result) process(options, [source]) # shutil.copy(result, expected) actual = yaml.full_load(open(result).read()) expected = yaml.full_load(open(expected).read()) self.assertEqual(actual, expected)
def test_convert_security_basic_local(self): source = RESOURCES_DIR + "/swagger/auth-basic-local.json" expected = RESOURCES_DIR + "/swagger/auth-basic-local-converted.yaml" result = self._get_tmp() options = FakeOptions(file_name=result) process(options, [source]) # shutil.copy(result, expected) actual = yaml.load(open(result).read()) expected = yaml.load(open(expected).read()) self.assertEqual(actual, expected)
def test_convert(self): self.maxDiff = None source = RESOURCES_DIR + "/swagger/petstore.json" result = self._get_tmp() options = FakeOptions(file_name=result) process(options, [source]) actual = yaml.load(open(result).read()) expected = yaml.load( open(RESOURCES_DIR + "/swagger/petstore-converted.yaml").read()) self.assertEqual(actual, expected)
def test_convert_interpolation_none(self): source = RESOURCES_DIR + "/swagger/bzm-api.json" expected = RESOURCES_DIR + "/swagger/bzm-converted-none.yaml" result = self._get_tmp() options = FakeOptions(file_name=result, parameter_interpolation=Swagger.INTERPOLATE_DISABLE) process(options, [source]) # shutil.copy(result, expected) actual = yaml.load(open(result).read()) expected = yaml.load(open(expected).read()) self.assertEqual(actual, expected)