Skip to content

Commit

Permalink
added test for validity of pulled values
Browse files Browse the repository at this point in the history
  • Loading branch information
aradmaleki02 committed Feb 15, 2024
1 parent 99d9c65 commit c3aefdb
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions test/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@ def test_answer():



# def test_push_pull_many():
# for i in range(100):
# python_client.push(f"key_{i}", f"value_{i}".encode("utf-8"))
# num_failed = 0
# for i in range(100):
# key, value = python_client.pull()
# if key != f"key_{i}" or value != f"value_{i}".encode("utf-8"):
# num_failed += 1
# assert num_failed == 0
def test_push_pull_many():
for i in range(100):
python_client.push(f"key_{i}", f"value_{i}".encode("utf-8"))
num_failed = 0
for i in range(100):
key, value = python_client.pull()
# check if key index matches value index
if int(key.split("_")[1]) != int(value.decode("utf-8").split("_")[1]):
num_failed += 1

assert num_failed == 0



Expand Down

0 comments on commit c3aefdb

Please sign in to comment.