Implement testing the removal of IO pipes on server stop
This commit is contained in:
parent
295a53a44c
commit
5091380133
@ -55,5 +55,6 @@ class PipeIOServer(ABC):
|
|||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
for thread in self._io_threads:
|
for thread in self._io_threads:
|
||||||
|
if thread.isAlive():
|
||||||
thread.stop()
|
thread.stop()
|
||||||
PipeHandler(self.in_pipe, self.out_pipe).remove()
|
PipeHandler(self.in_pipe, self.out_pipe).remove()
|
||||||
|
6
tests.py
6
tests.py
@ -44,6 +44,12 @@ def test_echo_server(pipe_io, test_data):
|
|||||||
assert File(pipe_io.out_pipe).read() == test_data
|
assert File(pipe_io.out_pipe).read() == test_data
|
||||||
|
|
||||||
|
|
||||||
|
def test_stop_removes_pipes(pipe_io):
|
||||||
|
pipe_io.stop()
|
||||||
|
for path in (pipe_io.in_pipe, pipe_io.out_pipe):
|
||||||
|
assert not exists(path)
|
||||||
|
|
||||||
|
|
||||||
class File:
|
class File:
|
||||||
def __init__(self, path):
|
def __init__(self, path):
|
||||||
self.path = path
|
self.path = path
|
||||||
|
Loading…
Reference in New Issue
Block a user