added a test loop for the client

This commit is contained in:
2022-05-28 20:30:29 +02:00
parent 9eb6bab32f
commit caff646c0c

33
test.py Executable file
View File

@ -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)