mirror of https://github.com/flaggo/pydu.git
Restore original socket after test execution of test_check_connect (#19)
This commit is contained in:
parent
4a1c2f15f7
commit
e6e4055f81
|
@ -50,8 +50,10 @@ def test_check_connect(port=None):
|
||||||
def mock_socket(*args):
|
def mock_socket(*args):
|
||||||
raise socket.error
|
raise socket.error
|
||||||
|
|
||||||
|
old_socket = pydu.request.socket.socket
|
||||||
pydu.request.socket.socket = mock_socket
|
pydu.request.socket.socket = mock_socket
|
||||||
assert not check_connect('127.0.0.1', port=port, timeout=0.01)
|
assert not check_connect('127.0.0.1', port=port, timeout=0.01)
|
||||||
|
pydu.request.socket.socket = old_socket
|
||||||
|
|
||||||
|
|
||||||
def test_update_query_params():
|
def test_update_query_params():
|
||||||
|
|
Loading…
Reference in New Issue