From 1540f6d3a7a2ba698577bee1d88c7203cf01e2c3 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:22:50 +0200 Subject: [PATCH] Implement step to insert route. --- spec/test/features/steps/steps.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/test/features/steps/steps.py b/spec/test/features/steps/steps.py index f8c4df9..0eb81bc 100644 --- a/spec/test/features/steps/steps.py +++ b/spec/test/features/steps/steps.py @@ -160,7 +160,12 @@ def step_impl(context, id): @when('I insert the route') def step_impl(context): - raise NotImplementedError('STEP: When I insert the route') + if not hasattr(context, 'table'): + raise RuntimeError("A table must be set for this step.") + + row = context.table[0] + context.response = requests.put(f"{Env.KAPOW_CONTROLAPI_URL}/routes", + json={h: row[h] for h in row.headings}) @when('I try to append with this malformed JSON document')