From f840de2b5908d9530d4438bc00b4239a63c15dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Wed, 21 Aug 2019 11:58:09 +0200 Subject: [PATCH] Use text instead of table for raw JSON passing --- spec/test/features/steps/steps.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spec/test/features/steps/steps.py b/spec/test/features/steps/steps.py index 3b4b869..cc2cab2 100644 --- a/spec/test/features/steps/steps.py +++ b/spec/test/features/steps/steps.py @@ -117,12 +117,9 @@ def step_impl(context): @when('I append the route') def step_impl(context): - if not hasattr(context, 'table'): - raise RuntimeError("A table must be set for this step.") - - row = context.table[0] context.response = requests.post(f"{Env.KAPOW_CONTROLAPI_URL}/routes", - json={h: row[h] for h in row.headings}) + data=context.text, + headers={"Content-Type": "application/json"}) @then('I get {code} as response code')