Implement testing the removal of IO pipes on server stop

This commit is contained in:
Kristóf Tóth 2018-12-15 01:07:02 +01:00
parent 295a53a44c
commit 5091380133
2 changed files with 8 additions and 1 deletions

View File

@ -55,5 +55,6 @@ class PipeIOServer(ABC):
def stop(self):
for thread in self._io_threads:
thread.stop()
if thread.isAlive():
thread.stop()
PipeHandler(self.in_pipe, self.out_pipe).remove()

View File

@ -44,6 +44,12 @@ def test_echo_server(pipe_io, 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:
def __init__(self, path):
self.path = path