Implement test case for IO stress

This commit is contained in:
Kristóf Tóth 2018-12-16 22:54:15 +01:00
parent b7bc795289
commit 929502a586

View File

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