14
0
Files
python-vncdotool/fix-mocking.patch
Steve Kowalik 8c5960598f - Add patch remove-nose.patch:
* Stop requiring nose for the test suite.
- Add patch fix-mocking.patch:
  * Use correct form of mocking for a UNIX domain socket test.
- Use pytest to run the test suite.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-vncdotool?expand=0&rev=4
2021-11-01 04:48:34 +00:00

23 lines
833 B
Diff

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