forked from pool/python-vncdotool
- 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
This commit is contained in:
22
fix-mocking.patch
Normal file
22
fix-mocking.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
Reference in New Issue
Block a user