diff --git a/tests.py b/tests.py index 90a3cf8..7bec774 100644 --- a/tests.py +++ b/tests.py @@ -3,6 +3,7 @@ from os import stat, urandom from os.path import exists, dirname, realpath, join from stat import S_ISFIFO from secrets import token_urlsafe +from random import randint import pytest @@ -65,6 +66,13 @@ def test_io_large_data(pipe_io, test_data_size): assert File(pipe_io.out_pipe).read() == random_data +def test_io_stress(pipe_io): + for _ in range(2222): + random_data = urandom(randint(1, 1024)) + File(pipe_io.in_pipe).write(random_data) + assert File(pipe_io.out_pipe).read() == random_data + + def test_stop_removes_pipes(pipe_io): pipe_io.stop() for path in (pipe_io.in_pipe, pipe_io.out_pipe):