You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To build and run execute the application under test: mvn clean install && java -jar target/spring-boot-web-*.jar
Actual behavior:
Example 1: vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/update/{id}', '/product/delete/{id}', '/product/show/{id}', '/product/list', '/product/add']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['put']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 66, in swagger_fuzzer request = get_request(data, SPEC, SPEC_HOST) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 67, in get_request body_params = _get_filtered_parameter(endpoint, 'body', spec) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 51, in _get_filtered_parameter return CustomTransformation(get_ref, spec).transform(non_converted_params) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 126, in transform return self._transform_dict(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 140, in _transform_dict new_dict[key] = self.transform(value) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 188, in default transformed = self.transform(schema) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 180, in default properties[property_name] = self.transform(property_) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 191, in default raise Exception("Invalid", obj, parameter_type) Exception: ('Invalid', {'description': 'The price of the product', 'type': 'number'}, 'number')
Example2 vagrant@ubuntu-xenial:~$ swagger-fuzzer localhost:8080/v2/api-docs Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 52, in do swagger_spec = requests.get(settings.spec_url) File "/home/vagrant/.local/lib/python3.5/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/requests/sessions.py", line 612, in send adapter = self.get_adapter(url=request.url) File "/home/vagrant/.local/lib/python3.5/site-packages/requests/sessions.py", line 703, in get_adapter raise InvalidSchema("No connection adapters were found for '%s'" % url) requests.exceptions.InvalidSchema: No connection adapters were found for 'localhost:8080/v2/api-docs' vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/update/{id}', '/product/delete/{id}', '/product/show/{id}', '/product/list', '/product/add']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['put']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 66, in swagger_fuzzer request = get_request(data, SPEC, SPEC_HOST) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 67, in get_request body_params = _get_filtered_parameter(endpoint, 'body', spec) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 51, in _get_filtered_parameter return CustomTransformation(get_ref, spec).transform(non_converted_params) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 126, in transform return self._transform_dict(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 140, in _transform_dict new_dict[key] = self.transform(value) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 188, in default transformed = self.transform(schema) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 180, in default properties[property_name] = self.transform(property_) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 191, in default raise Exception("Invalid", obj, parameter_type) Exception: ('Invalid', {'description': 'The price of the product', 'type': 'number'}, 'number') vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/add', '/product/update/{id}', '/product/show/{id}', '/product/list', '/product/delete/{id}']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['post']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 66, in swagger_fuzzer request = get_request(data, SPEC, SPEC_HOST) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 67, in get_request body_params = _get_filtered_parameter(endpoint, 'body', spec) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 51, in _get_filtered_parameter return CustomTransformation(get_ref, spec).transform(non_converted_params) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 126, in transform return self._transform_dict(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 140, in _transform_dict new_dict[key] = self.transform(value) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 188, in default transformed = self.transform(schema) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 180, in default properties[property_name] = self.transform(property_) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 191, in default raise Exception("Invalid", obj, parameter_type) Exception: ('Invalid', {'description': 'The price of the product', 'type': 'number'}, 'number') vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/show/{id}', '/product/add', '/product/delete/{id}', '/product/list', '/product/update/{id}']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['get']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Curl command: curl -i -X GET -d '' 'http://localhost:8080/product/show/0' Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 72, in swagger_fuzzer validator(SPEC, request, result, settings) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/validators.py", line 53, in valid_output_mime if response.headers['Content-Type'] not in valids: File "/home/vagrant/.local/lib/python3.5/site-packages/requests/structures.py", line 54, in __getitem__ return self._store[key.lower()][1] KeyError: 'content-type'
Example 3 vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/show/{id}', '/product/list', '/product/add', '/product/update/{id}', '/product/delete/{id}']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['get']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Curl command: curl -i -X GET -d '' 'http://localhost:8080/product/show/0' Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 72, in swagger_fuzzer validator(SPEC, request, result, settings) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/validators.py", line 53, in valid_output_mime if response.headers['Content-Type'] not in valids: File "/home/vagrant/.local/lib/python3.5/site-packages/requests/structures.py", line 54, in __getitem__ return self._store[key.lower()][1] KeyError: 'content-type' vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/delete/{id}', '/product/list', '/product/update/{id}', '/product/show/{id}', '/product/add']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['delete']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with sampled_fromorchoices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Curl command: curl -i -X DELETE -H Content-Length: '0' -d '' 'http://localhost:8080/product/delete/0' Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 72, in swagger_fuzzer validator(SPEC, request, result, settings) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/validators.py", line 28, in no_server_error raise AssertionError("Request on {!r} returns status_code {}".format(URL, response.status_code)) NameError: name 'URL' is not defined
The text was updated successfully, but these errors were encountered:
Prerequisites:
Application under test: springframeworkguru/springboot_swagger_example@e41186e
How to reproduce:
To build and run execute the application under test:
mvn clean install && java -jar target/spring-boot-web-*.jar
Actual behavior:
Example 1:
vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/update/{id}', '/product/delete/{id}', '/product/show/{id}', '/product/list', '/product/add']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['put']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 66, in swagger_fuzzer request = get_request(data, SPEC, SPEC_HOST) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 67, in get_request body_params = _get_filtered_parameter(endpoint, 'body', spec) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 51, in _get_filtered_parameter return CustomTransformation(get_ref, spec).transform(non_converted_params) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 126, in transform return self._transform_dict(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 140, in _transform_dict new_dict[key] = self.transform(value) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 188, in default transformed = self.transform(schema) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 180, in default properties[property_name] = self.transform(property_) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 191, in default raise Exception("Invalid", obj, parameter_type) Exception: ('Invalid', {'description': 'The price of the product', 'type': 'number'}, 'number')
Example2
vagrant@ubuntu-xenial:~$ swagger-fuzzer localhost:8080/v2/api-docs Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 52, in do swagger_spec = requests.get(settings.spec_url) File "/home/vagrant/.local/lib/python3.5/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/requests/sessions.py", line 612, in send adapter = self.get_adapter(url=request.url) File "/home/vagrant/.local/lib/python3.5/site-packages/requests/sessions.py", line 703, in get_adapter raise InvalidSchema("No connection adapters were found for '%s'" % url) requests.exceptions.InvalidSchema: No connection adapters were found for 'localhost:8080/v2/api-docs' vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/update/{id}', '/product/delete/{id}', '/product/show/{id}', '/product/list', '/product/add']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['put']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 66, in swagger_fuzzer request = get_request(data, SPEC, SPEC_HOST) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 67, in get_request body_params = _get_filtered_parameter(endpoint, 'body', spec) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 51, in _get_filtered_parameter return CustomTransformation(get_ref, spec).transform(non_converted_params) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 126, in transform return self._transform_dict(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 140, in _transform_dict new_dict[key] = self.transform(value) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 188, in default transformed = self.transform(schema) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 180, in default properties[property_name] = self.transform(property_) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 191, in default raise Exception("Invalid", obj, parameter_type) Exception: ('Invalid', {'description': 'The price of the product', 'type': 'number'}, 'number') vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/add', '/product/update/{id}', '/product/show/{id}', '/product/list', '/product/delete/{id}']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['post']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 66, in swagger_fuzzer request = get_request(data, SPEC, SPEC_HOST) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 67, in get_request body_params = _get_filtered_parameter(endpoint, 'body', spec) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 51, in _get_filtered_parameter return CustomTransformation(get_ref, spec).transform(non_converted_params) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 126, in transform return self._transform_dict(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 140, in _transform_dict new_dict[key] = self.transform(value) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 188, in default transformed = self.transform(schema) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 180, in default properties[property_name] = self.transform(property_) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 122, in transform obj = self._recursive_transform(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 152, in _recursive_transform obj = self.default(obj) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_helpers.py", line 191, in default raise Exception("Invalid", obj, parameter_type) Exception: ('Invalid', {'description': 'The price of the product', 'type': 'number'}, 'number') vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/show/{id}', '/product/add', '/product/delete/{id}', '/product/list', '/product/update/{id}']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['get']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Curl command: curl -i -X GET -d '' 'http://localhost:8080/product/show/0' Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 72, in swagger_fuzzer validator(SPEC, request, result, settings) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/validators.py", line 53, in valid_output_mime if response.headers['Content-Type'] not in valids: File "/home/vagrant/.local/lib/python3.5/site-packages/requests/structures.py", line 54, in __getitem__ return self._store[key.lower()][1] KeyError: 'content-type'
Example 3
vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/show/{id}', '/product/list', '/product/add', '/product/update/{id}', '/product/delete/{id}']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['get']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Curl command: curl -i -X GET -d '' 'http://localhost:8080/product/show/0' Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 72, in swagger_fuzzer validator(SPEC, request, result, settings) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/validators.py", line 53, in valid_output_mime if response.headers['Content-Type'] not in valids: File "/home/vagrant/.local/lib/python3.5/site-packages/requests/structures.py", line 54, in __getitem__ return self._store[key.lower()][1] KeyError: 'content-type' vagrant@ubuntu-xenial:~$ swagger-fuzzer http://localhost:8080/v2/api-docs /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['/product/delete/{id}', '/product/list', '/product/update/{id}', '/product/show/{id}', '/product/add']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) /home/vagrant/.local/lib/python3.5/site-packages/hypothesis/strategies.py:469: HypothesisDeprecationWarning: Cannot sample from dict_keys(['delete']), not a sequence. Hypothesis goes to some length to ensure that sampling an element from a collection (with
sampled_fromor
choices) is replayable and can be minimised. To replay a saved example, the sampled values must have the same iteration order on every run - ruling out sets, dicts, etc due to hash randomisation. Most cases can simply use
sorted(values), but mixed types or special values such as math.nan require careful handling - and note that when simplifying an example, Hypothesis treats earlier values as simpler. values = check_sample(elements) Falsifying example: swagger_fuzzer(data=request(...)) Curl command: curl -i -X DELETE -H Content-Length: '0' -d '' 'http://localhost:8080/product/delete/0' Traceback (most recent call last): File "/home/vagrant/.local/bin/swagger-fuzzer", line 9, in <module> load_entry_point('swagger-fuzzer==0.1.0', 'console_scripts', 'swagger-fuzzer')() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 30, in main do(args) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 75, in do swagger_fuzzer() File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 1001, in wrapped_test state.run() File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 817, in run falsifying_example.__expected_traceback, File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 578, in execute result = self.test_runner(data, run) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/executors.py", line 58, in default_new_style_executor return function(data) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 570, in run return test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 64, in swagger_fuzzer @hsettings(max_examples=settings.iterations) File "/home/vagrant/.local/lib/python3.5/site-packages/hypothesis/core.py", line 517, in test result = self.test(*args, **kwargs) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/swagger_fuzzer.py", line 72, in swagger_fuzzer validator(SPEC, request, result, settings) File "/home/vagrant/.local/lib/python3.5/site-packages/swagger_fuzzer/validators.py", line 28, in no_server_error raise AssertionError("Request on {!r} returns status_code {}".format(URL, response.status_code)) NameError: name 'URL' is not defined
The text was updated successfully, but these errors were encountered: