Implement test case for IO stress
This commit is contained in:
parent
b7bc795289
commit
929502a586
8
tests.py
8
tests.py
@ -3,6 +3,7 @@ from os import stat, urandom
|
|||||||
from os.path import exists, dirname, realpath, join
|
from os.path import exists, dirname, realpath, join
|
||||||
from stat import S_ISFIFO
|
from stat import S_ISFIFO
|
||||||
from secrets import token_urlsafe
|
from secrets import token_urlsafe
|
||||||
|
from random import randint
|
||||||
|
|
||||||
import pytest
|
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
|
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):
|
def test_stop_removes_pipes(pipe_io):
|
||||||
pipe_io.stop()
|
pipe_io.stop()
|
||||||
for path in (pipe_io.in_pipe, pipe_io.out_pipe):
|
for path in (pipe_io.in_pipe, pipe_io.out_pipe):
|
||||||
|
Loading…
Reference in New Issue
Block a user