From e4a263fee4a7cd74711a80c86349f3487f40cf4b Mon Sep 17 00:00:00 2001 From: Tobias Eidelpes Date: Tue, 19 Jan 2021 20:03:06 +0100 Subject: [PATCH] Run faker three times --- iotclient/iot_client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iotclient/iot_client.py b/iotclient/iot_client.py index b6968e2..1dbc012 100644 --- a/iotclient/iot_client.py +++ b/iotclient/iot_client.py @@ -287,11 +287,16 @@ def test_script(argv): command = "dummy" test_script(sys.argv[1:]) i = 0 -while (command.lower() not in ["exit", "quit", "end"]): +j = 0 +while (command.lower() not in ["exit", "quit", "end"] and j < 3): try: if testscriptData[0] and i < testscriptData[1]: command = testCommands[i] + if (command.lower() == "exit" and j < 3): + i = 1 + j += 1 + command = testCommands[i] if i > 0: time.sleep(random.randrange(1, 5)) print(datetime.now())