From 93a3562c04143068dae8c3e46c5c729528eb09b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Fri, 23 Aug 2019 11:53:11 +0200 Subject: [PATCH] Empty response body step is too restrictive --- spec/test/features/control/append/error_malformed.feature | 1 - spec/test/features/control/delete/error_notfound.feature | 1 - spec/test/features/control/delete/list_order.feature | 3 --- spec/test/features/control/insert/error_malformed.feature | 1 - spec/test/features/steps/steps.py | 5 ----- 5 files changed, 11 deletions(-) diff --git a/spec/test/features/control/append/error_malformed.feature b/spec/test/features/control/append/error_malformed.feature index 4c4f9f0..772b063 100644 --- a/spec/test/features/control/append/error_malformed.feature +++ b/spec/test/features/control/append/error_malformed.feature @@ -21,4 +21,3 @@ Feature: Kapow! server reject append requests with malformed JSON bodies. """ Then I get 400 as response code And I get "Malformed JSON" as response reason phrase - And I get an empty response body diff --git a/spec/test/features/control/delete/error_notfound.feature b/spec/test/features/control/delete/error_notfound.feature index 81ddedd..3fae753 100644 --- a/spec/test/features/control/delete/error_notfound.feature +++ b/spec/test/features/control/delete/error_notfound.feature @@ -10,4 +10,3 @@ Feature: Fail to delete a route in Kapow! server. When I delete the route with id "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx" Then I get 404 as response code And I get "Not Found" as response reason phrase - And I get an empty response body diff --git a/spec/test/features/control/delete/list_order.feature b/spec/test/features/control/delete/list_order.feature index d3fb0c2..ee0c97e 100644 --- a/spec/test/features/control/delete/list_order.feature +++ b/spec/test/features/control/delete/list_order.feature @@ -20,7 +20,6 @@ Feature: Routes auto-ordering after deleting in a Kapow! server. When I delete the first route inserted Then I get 200 as response code And I get "OK" as response reason phrase - And I get an empty response body When I request a routes listing Then I get 200 as response code And I get "OK" as response reason phrase @@ -61,7 +60,6 @@ Feature: Routes auto-ordering after deleting in a Kapow! server. When I delete the last route inserted Then I get 200 as response code And I get "OK" as response reason phrase - And I get an empty response body When I request a routes listing Then I get 200 as response code And I get "OK" as response reason phrase @@ -103,7 +101,6 @@ Feature: Routes auto-ordering after deleting in a Kapow! server. When I delete the second route inserted Then I get 200 as response code And I get "OK" as response reason phrase - And I get an empty response body When I request a routes listing Then I get 200 as response code And I get "OK" as response reason phrase diff --git a/spec/test/features/control/insert/error_malformed.feature b/spec/test/features/control/insert/error_malformed.feature index 9216577..4b50e94 100644 --- a/spec/test/features/control/insert/error_malformed.feature +++ b/spec/test/features/control/insert/error_malformed.feature @@ -22,4 +22,3 @@ Feature: Kapow! server reject insert requests with malformed JSON bodies. """ Then I get 400 as response code And I get "Malformed JSON" as response reason phrase - And I get an empty response body diff --git a/spec/test/features/steps/steps.py b/spec/test/features/steps/steps.py index e877a7c..45fc051 100644 --- a/spec/test/features/steps/steps.py +++ b/spec/test/features/steps/steps.py @@ -128,11 +128,6 @@ def step_impl(context): assert is_subset(jsonexample.loads(context.text), context.response.json()) -@then('I get an empty response body') -def step_impl(context): - assert context.response.content == b'', f"Response body is not empty. Got {context.response.content} instead." - - @when('I delete the route with id "{id}"') def step_impl(context, id): context.response = requests.delete(f"{Env.KAPOW_CONTROLAPI_URL}/routes/{id}")