diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_lib.py b/tests/test_lib.py new file mode 100644 index 0000000..270dc64 --- /dev/null +++ b/tests/test_lib.py @@ -0,0 +1,16 @@ +import time + +from retry_later import retry_later + + +@retry_later() +def write_to_file(file_name: str, body: str): + with open(file_name, "w") as f: + f.write(body) + + +def test_success_once(): + write_to_file("test.txt", "hello world") + time.sleep(5) + with open("test.txt") as f: + assert "hello world" in f.readlines()