Index: vncdotool-1.0.0/tests/unit/test_command.py =================================================================== --- vncdotool-1.0.0.orig/tests/unit/test_command.py +++ vncdotool-1.0.0/tests/unit/test_command.py @@ -1,5 +1,6 @@ from vncdotool import command +import os.path import socket import unittest import mock @@ -207,8 +208,8 @@ class TestParseServer(object): assert port == 1111 def test_unix_socket(self): - command.os.path.exists.return_value = True - family, host, port = command.parse_server('/some/path/unix.skt') + with mock.patch.object(os.path, 'exists', return_value=True): + family, host, port = command.parse_server('/some/path/unix.skt') assert family == socket.AF_UNIX assert host == '/some/path/unix.skt' assert port == 5900