olipratt / swagger-conformance Goto Github PK
View Code? Open in Web Editor NEWPython based tool for testing whether your API conforms to its Swagger schema
Home Page: http://swagger-conformance.readthedocs.io/en/latest/
License: MIT License
Python based tool for testing whether your API conforms to its Swagger schema
Home Page: http://swagger-conformance.readthedocs.io/en/latest/
License: MIT License
Hi, thanks for this wonderful library. I am using with great pleasure for both closed and opened source projects.
But, currently I am developing a new REST framework for django
. And I am building it with openapi-v3-first support.
It is called wemake-django-rest
, it is currently in design step. You can see how the research is going in this issue: wemake-services/wemake-django-rest#1 Btw, I will appreciate any feedback from you.
I am planning to use this module as one of the main testing features of the whole framework.
But, it currently does not support openapi v3.
Do you have any plans to support it? Will it be hard to do?
Can you please give any hints of what needs to be done?
Cheers!
>>> import swaggerconformance
>>> client = swaggerconformance.client.Client('http://petstore.swagger.io/v2/swagger.json')
No success responses defined - allowing 200
No success responses defined - allowing 200
No success responses defined - allowing 200
No success responses defined - allowing 200
No success responses defined - allowing 200
Only 'default' response defined - allowing any 2XX
Only 'default' response defined - allowing any 2XX
No success responses defined - allowing 200
No success responses defined - allowing 200
Only 'default' response defined - allowing any 2XX
Only 'default' response defined - allowing any 2XX
>>> strategy_factory = swaggerconformance.strategies.StrategyFactory()
>>> operation = client.api.endpoints["/pet"]["put"]
>>> strategy = operation.parameters_strategy(strategy_factory)
>>> strategy.example()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py", line 315, in example
example_generating_inner_function()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py", line 303, in example_generating_inner_function
@settings(
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/core.py", line 975, in wrapped_test
wrapped_test, arguments, kwargs, given_kwargs, argspec, settings,
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/core.py", line 415, in process_arguments_to_given
search_strategy.validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py", line 378, in validate
self.do_validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/collections.py", line 39, in do_validate
s.validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py", line 378, in validate
self.do_validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py", line 646, in do_validate
self.mapped_strategy.validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py", line 378, in validate
self.do_validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 118, in do_validate
w.validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py", line 378, in validate
self.do_validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py", line 646, in do_validate
self.mapped_strategy.validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py", line 378, in validate
self.do_validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/collections.py", line 39, in do_validate
s.validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py", line 378, in validate
self.do_validate()
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 116, in do_validate
w = self.wrapped_strategy
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 101, in wrapped_strategy
unwrapped_args = tuple(unwrap_strategies(s) for s in self.__args)
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 101, in <genexpr>
unwrapped_args = tuple(unwrap_strategies(s) for s in self.__args)
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 45, in unwrap_strategies
result = unwrap_strategies(s.wrapped_strategy)
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 101, in wrapped_strategy
unwrapped_args = tuple(unwrap_strategies(s) for s in self.__args)
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 101, in <genexpr>
unwrapped_args = tuple(unwrap_strategies(s) for s in self.__args)
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 45, in unwrap_strategies
result = unwrap_strategies(s.wrapped_strategy)
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 101, in wrapped_strategy
unwrapped_args = tuple(unwrap_strategies(s) for s in self.__args)
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 101, in <genexpr>
unwrapped_args = tuple(unwrap_strategies(s) for s in self.__args)
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 45, in unwrap_strategies
result = unwrap_strategies(s.wrapped_strategy)
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py", line 106, in wrapped_strategy
base = self.function(*self.__args, **self.__kwargs)
File "/home/jbenton/.local/share/virtualenvs/swagger-conformance-X22JbcNe/lib/python3.7/site-packages/hypothesis/strategies/_internal/core.py", line 650, in sampled_from
raise InvalidArgument("Cannot sample from a length-zero sequence.")
hypothesis.errors.InvalidArgument: Cannot sample from a length-zero sequence.
The Python Packaging Authority has recently created a new trove classifier to help users find Hypothesis-related packages, as described and demonstrated in HypothesisWorks/hypothesis#1663.
It would be great if this package used it too!
I generate my Swagger with flask-restx and I wondered if there is any benefit to use swagger-conformance then. I it possible with flask-restx to not be conformant to the generated swagger?
If it provides value, is there anything special how to use them together?
If I run the example provided in the README against a Swagger URL, I get an error:
$ python -m swaggerconformance 'https://api.wellcomecollection.org/catalogue/v1/swagger.json'
usage: python -m swaggerconformance [-h] [-n N] schema_path
python -m swaggerconformance: error: unrecognized arguments: https://api.wellcomecollection.org/catalogue/v1/swagger.json
The issue is in __main__.py
: you're passing sys.argv
into main()
, which includes everything – including the name of the running program. Better would be to use sys.argv[1:]
.
Note that if you don’t pass anything into ArgumentParser.parse_args
, I think it picks the correct arguments for you.
I’d submit a patch, but I’m having trouble constructing a URL that I can pass as schema_path
to verify it’s working correctly in the tests.
$ pip freeze
attrs==17.4.0
certifi==2018.1.18
chardet==3.0.4
coverage==4.5.1
hypothesis==3.55.4
idna==2.6
pyaml==17.12.1
pyswagger==0.8.37
PyYAML==3.12
requests==2.18.4
six==1.11.0
swagger-conformance==0.2.2
urllib3==1.22
validate-email==1.3
$ python --version
Python 3.6.1
If I do a local patch for #2, and run the tool again, I get a complaint about Content-Type headers:
$ python -m swaggerconformance 'https://api.wellcomecollection.org/catalogue/v1/swagger.json'
AssertionError: application/json not in ['application/json; charset=utf-8']
I’ve included the traceback below. Also, this error message should explain what the significance of the quoted header is, rather than having me poke around in the traceback to discover it‘s the Content-Type header.
Same versions as in #2.
Validation failed of operation: Operation(id=None, method='get', path='/works', params={'page': Parameter(name='page', type='integer', format='int32', required=False), 'pageSize': Parameter(name='pageSize', type='integer', format='int32', required=False), 'query': Parameter(name='query', type='string', format=None, required=False), 'includes': Parameter(name='includes', type='array', format=None, required=False)})
Traceback (most recent call last):
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 34, in api_conformance_test
operation_conformance_test(client, operation, num_tests_per_op)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 86, in operation_conformance_test
single_operation_test(client, operation) # pylint: disable=E1120
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 62, in single_operation_test
max_examples=num_tests,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 1054, in wrapped_test
state.run()
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 822, in run
falsifying_example.__expected_traceback,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 583, in execute
result = self.test_runner(data, run)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor
return function(data)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 575, in run
return test(*args, **kwargs)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 62, in single_operation_test
max_examples=num_tests,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 522, in test
result = self.test(*args, **kwargs)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 76, in single_operation_test
result = client.request(operation, params)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/client.py", line 70, in request
result = client.request(operation._pyswagger_operation(**parameters)) # pylint: disable=protected-access
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/contrib/client/requests.py", line 74, in request
raw=six.BytesIO(rs.content).getvalue()
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/io.py", line 417, in apply_with
self.__data = r.schema._prim_(data, self.__op._prim_factory, ctx=dict(read=True))
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/spec/v2_0/objects.py", line 92, in _prim_
return prim_factory.produce(self, v, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/__init__.py", line 192, in produce
val = _2nd(obj, ret, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/comm.py", line 40, in _2nd_pass_obj
return ret.apply_with(obj, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/_model.py", line 29, in apply_with
self[k] = ctx['factory'].produce(pobj, v)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/__init__.py", line 192, in produce
val = _2nd(obj, ret, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/comm.py", line 40, in _2nd_pass_obj
return ret.apply_with(obj, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/_array.py", line 48, in apply_with
self.extend(map(functools.partial(ctx['factory'].produce, obj.items), val))
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/__init__.py", line 192, in produce
val = _2nd(obj, ret, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/comm.py", line 40, in _2nd_pass_obj
return ret.apply_with(obj, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/_model.py", line 29, in apply_with
self[k] = ctx['factory'].produce(pobj, v)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/__init__.py", line 192, in produce
val = _2nd(obj, ret, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/comm.py", line 40, in _2nd_pass_obj
return ret.apply_with(obj, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/_model.py", line 23, in apply_with
for k, v in six.iteritems(val):
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/six.py", line 587, in iteritems
return iter(d.items(**kw))
AttributeError: 'list' object has no attribute 'items'
Validation failed of operation: Operation(id=None, method='get', path='/works/{id}', params={'id': Parameter(name='id', type='string', format=None, required=True), 'includes': Parameter(name='includes', type='array', format=None, required=False)})
Traceback (most recent call last):
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 34, in api_conformance_test
operation_conformance_test(client, operation, num_tests_per_op)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 86, in operation_conformance_test
single_operation_test(client, operation) # pylint: disable=E1120
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 62, in single_operation_test
max_examples=num_tests,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 1054, in wrapped_test
state.run()
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 822, in run
falsifying_example.__expected_traceback,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 583, in execute
result = self.test_runner(data, run)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor
return function(data)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 575, in run
return test(*args, **kwargs)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 62, in single_operation_test
max_examples=num_tests,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 522, in test
result = self.test(*args, **kwargs)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 82, in single_operation_test
"application/json not in {}".format(result.headers['Content-Type'])
AssertionError: application/json not in ['application/json; charset=utf-8']
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/__main__.py", line 38, in <module>
main()
File "/Users/chana/repos/swagger-conformance/swaggerconformance/__main__.py", line 32, in main
_run_comformance_test(parsed_args)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/__main__.py", line 27, in _run_comformance_test
num_tests_per_op=parsed_args.num_tests_per_op)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 45, in api_conformance_test
'\n'.join(hit_errors)))
Exception: 2 operation(s) failed conformance tests - check output in logging and tracebacks below for details
Traceback (most recent call last):
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 34, in api_conformance_test
operation_conformance_test(client, operation, num_tests_per_op)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 86, in operation_conformance_test
single_operation_test(client, operation) # pylint: disable=E1120
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 62, in single_operation_test
max_examples=num_tests,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 1054, in wrapped_test
state.run()
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 822, in run
falsifying_example.__expected_traceback,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 583, in execute
result = self.test_runner(data, run)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor
return function(data)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 575, in run
return test(*args, **kwargs)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 62, in single_operation_test
max_examples=num_tests,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 522, in test
result = self.test(*args, **kwargs)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 76, in single_operation_test
result = client.request(operation, params)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/client.py", line 70, in request
result = client.request(operation._pyswagger_operation(**parameters)) # pylint: disable=protected-access
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/contrib/client/requests.py", line 74, in request
raw=six.BytesIO(rs.content).getvalue()
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/io.py", line 417, in apply_with
self.__data = r.schema._prim_(data, self.__op._prim_factory, ctx=dict(read=True))
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/spec/v2_0/objects.py", line 92, in _prim_
return prim_factory.produce(self, v, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/__init__.py", line 192, in produce
val = _2nd(obj, ret, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/comm.py", line 40, in _2nd_pass_obj
return ret.apply_with(obj, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/_model.py", line 29, in apply_with
self[k] = ctx['factory'].produce(pobj, v)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/__init__.py", line 192, in produce
val = _2nd(obj, ret, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/comm.py", line 40, in _2nd_pass_obj
return ret.apply_with(obj, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/_array.py", line 48, in apply_with
self.extend(map(functools.partial(ctx['factory'].produce, obj.items), val))
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/__init__.py", line 192, in produce
val = _2nd(obj, ret, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/comm.py", line 40, in _2nd_pass_obj
return ret.apply_with(obj, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/_model.py", line 29, in apply_with
self[k] = ctx['factory'].produce(pobj, v)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/__init__.py", line 192, in produce
val = _2nd(obj, ret, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/comm.py", line 40, in _2nd_pass_obj
return ret.apply_with(obj, val, ctx)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/pyswagger/primitives/_model.py", line 23, in apply_with
for k, v in six.iteritems(val):
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/six.py", line 587, in iteritems
return iter(d.items(**kw))
AttributeError: 'list' object has no attribute 'items'
Traceback (most recent call last):
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 34, in api_conformance_test
operation_conformance_test(client, operation, num_tests_per_op)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 86, in operation_conformance_test
single_operation_test(client, operation) # pylint: disable=E1120
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 62, in single_operation_test
max_examples=num_tests,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 1054, in wrapped_test
state.run()
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 822, in run
falsifying_example.__expected_traceback,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 583, in execute
result = self.test_runner(data, run)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor
return function(data)
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 575, in run
return test(*args, **kwargs)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 62, in single_operation_test
max_examples=num_tests,
File "/Users/chana/.virtualenvs/swcon/lib/python3.6/site-packages/hypothesis/core.py", line 522, in test
result = self.test(*args, **kwargs)
File "/Users/chana/repos/swagger-conformance/swaggerconformance/_basictests.py", line 82, in single_operation_test
"application/json not in {}".format(result.headers['Content-Type'])
AssertionError: application/json not in ['application/json; charset=utf-8']
Falsifying example: single_operation_test(client=Client(schema_path='https://api.wellcomecollection.org/catalogue/v1/swagger.json'), operation=Operation(id=None, method='get', path='/works', params={'page': Parameter(name='page', type='integer', format='int32', required=False), 'pageSize': Parameter(name='pageSize', type='integer', format='int32', required=False), 'query': Parameter(name='query', type='string', format=None, required=False), 'includes': Parameter(name='includes', type='array', format=None, required=False)}), params={})
Falsifying example: single_operation_test(client=Client(schema_path='https://api.wellcomecollection.org/catalogue/v1/swagger.json'), operation=Operation(id=None, method='get', path='/works/{id}', params={'id': Parameter(name='id', type='string', format=None, required=True), 'includes': Parameter(name='includes', type='array', format=None, required=False)}), params={'id': '0'})
Hi,
How do I configure basic auth?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.