From caff646c0c801ed25dc9933579a9d327dc432393 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Sat, 28 May 2022 20:30:29 +0200 Subject: [PATCH] added a test loop for the client --- test.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 test.py diff --git a/test.py b/test.py new file mode 100755 index 0000000..381ed05 --- /dev/null +++ b/test.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +from itertools import count, cycle +from random import random, randint +from string import ascii_letters +from time import sleep + +from client import Client + + +def irandom(): + while True: + yield random() + +num = count() +ran = irandom() +let = cycle(ascii_letters) + +c = Client() + +c.clear() +sleep(1) + +for i, r, l in zip(num, ran, let): + l = l * randint(1, 5) + + kwargs = {} if i < 10 else {"x": 123} + + c.add_row(index=i, random=r, string=l, **kwargs) + sleep(2) + + +