mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-05-08 10:04:27 +02:00
Don't use nested.
Is Python 2.x only. Not supported under Python 3.x.
This commit is contained in:
parent
cf0aaa7134
commit
9d443e4155
@ -1,5 +1,4 @@
|
||||
from mock import Mock, patch, call
|
||||
from contextlib import nested
|
||||
import io
|
||||
import os
|
||||
import os.path
|
||||
@ -63,11 +62,9 @@ def test_rewrite_etc_hosts():
|
||||
assert filecmp.cmp("tmp/hosts.orig", "tmp/hosts", shallow=False) is True
|
||||
|
||||
|
||||
def test_main():
|
||||
with nested(
|
||||
patch('sshuttle.firewall.setup_daemon'),
|
||||
patch('sshuttle.firewall.get_method')
|
||||
) as (mock_setup_daemon, mock_get_method):
|
||||
@patch('sshuttle.firewall.setup_daemon')
|
||||
@patch('sshuttle.firewall.get_method')
|
||||
def test_main(mock_get_method, mock_setup_daemon):
|
||||
stdin, stdout = setup_daemon()
|
||||
mock_setup_daemon.return_value = stdin, stdout
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user