From b5cd09d12e4d76bd520a78f022c05c9f33a88342 Mon Sep 17 00:00:00 2001 From: Lars Falk-Petersen Date: Thu, 26 Sep 2024 15:18:40 +0200 Subject: [PATCH] Rename test_edr_position_extent and adjust debug log. --- sedr/schemat.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sedr/schemat.py b/sedr/schemat.py index e66ca78..02755de 100644 --- a/sedr/schemat.py +++ b/sedr/schemat.py @@ -59,15 +59,13 @@ def test_openapi(case): @schemathesis.hook -def after_call(self, response, case): +def after_call(context, case, response): """Hook runs after any call to the API.""" - if case.request: + if response.request: # Log calls with status util.logger.debug( - "after_call URL %s gave %s - %s", - case.request.path_url, - case.status_code, - case.text[0:150], + f"after_call {'OK' if response.ok else 'ERR'} " + \ + f"{response.request.path_url} {response.text[0:150]}" ) @@ -188,7 +186,7 @@ def test_edr_collections(case): @schema.include(path_regex="/position$").parametrize() @settings(max_examples=util.args.iterations, deadline=None) - def test_edr_positions(case): + def test_edr_position_extent(case): """The default test in function test_openapi will fuzz the coordinates. This function will test response given by coords inside and outside of the extent.