From fa1a7687e5f1c5bf1ea450221501ddd9ff56d5b1 Mon Sep 17 00:00:00 2001 From: Oleksii Kliukin Date: Tue, 1 Mar 2016 22:00:30 +0100 Subject: [PATCH] Correct the step definition, randomize the table. Make sure the step definition does not include "command" worlds. Use the table name that includes current timestamp in the tests. --- features/patroni_api.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/features/patroni_api.py b/features/patroni_api.py index 188f93cb..44de0f56 100644 --- a/features/patroni_api.py +++ b/features/patroni_api.py @@ -49,7 +49,7 @@ class PatroniAPISteps(object): self.do_post(step, url, None) def do_post(self, step, url, data): - '''I issue a POST request to (https?://(?:\w|\.|:|/)+) with (\s*\w+\s*=\s*\w+\s*,?)+''' + '''I issue a POST request to (https?://(?:\w|\.|:|/)+) with ((?:\s*\w+\s*=\s*\w+\s*,?)+)''' post_data = {} if data: post_components = data.split(',') @@ -80,11 +80,11 @@ class PatroniAPISteps(object): assert self.response[component] == data, "{0} does not contain {1}".format(component, data) def replication_works(self, step, time_limit): - '''And replication works after (\d+) seconds''' + '''replication works after (\d+) seconds''' step.behave_as(""" - When I add the table foo to postgres0 - Then table foo is present on postgres1 after {0} seconds - """.format(time_limit)) + When I add the table test_{0} to postgres0 + Then table test_{0} is present on postgres1 after {1} seconds + """.format(int(time.time()), time_limit)) PatroniAPISteps(world)