ipc: Add some more tests for _atime_timer.
This commit is contained in:
parent
1dba5b0bbd
commit
87ccc31cce
@ -366,7 +366,7 @@ class IPCServer(QObject):
|
|||||||
self._socket.deleteLater()
|
self._socket.deleteLater()
|
||||||
self._socket = None
|
self._socket = None
|
||||||
self._timer.stop()
|
self._timer.stop()
|
||||||
if self._atime_timer is not None:
|
if self._atime_timer is not None: # pragma: no branch
|
||||||
self._atime_timer.stop()
|
self._atime_timer.stop()
|
||||||
try:
|
try:
|
||||||
self._atime_timer.timeout.disconnect(self.update_atime)
|
self._atime_timer.timeout.disconnect(self.update_atime)
|
||||||
|
@ -343,6 +343,21 @@ class TestListen:
|
|||||||
|
|
||||||
assert old_atime != new_atime
|
assert old_atime != new_atime
|
||||||
|
|
||||||
|
@pytest.mark.posix
|
||||||
|
def test_atime_update_no_name(self, qtbot, caplog, ipc_server):
|
||||||
|
with caplog.atLevel(logging.ERROR):
|
||||||
|
ipc_server.update_atime()
|
||||||
|
|
||||||
|
records = caplog.records()
|
||||||
|
assert len(records) == 1
|
||||||
|
assert records[0].msg == "In update_atime with no server path!"
|
||||||
|
|
||||||
|
@pytest.mark.posix
|
||||||
|
def test_atime_shutdown_typeerror(self, qtbot, ipc_server):
|
||||||
|
"""This should never happen, but let's handle it gracefully."""
|
||||||
|
ipc_server._atime_timer.timeout.disconnect(ipc_server.update_atime)
|
||||||
|
ipc_server.shutdown()
|
||||||
|
|
||||||
|
|
||||||
class TestOnError:
|
class TestOnError:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user