Commit 9d443e41 authored by Brian May's avatar Brian May

Don't use nested.

Is Python 2.x only. Not supported under Python 3.x.
parent cf0aaa71
from mock import Mock, patch, call from mock import Mock, patch, call
from contextlib import nested
import io import io
import os import os
import os.path import os.path
...@@ -63,11 +62,9 @@ def test_rewrite_etc_hosts(): ...@@ -63,11 +62,9 @@ def test_rewrite_etc_hosts():
assert filecmp.cmp("tmp/hosts.orig", "tmp/hosts", shallow=False) is True assert filecmp.cmp("tmp/hosts.orig", "tmp/hosts", shallow=False) is True
def test_main(): @patch('sshuttle.firewall.setup_daemon')
with nested( @patch('sshuttle.firewall.get_method')
patch('sshuttle.firewall.setup_daemon'), def test_main(mock_get_method, mock_setup_daemon):
patch('sshuttle.firewall.get_method')
) as (mock_setup_daemon, mock_get_method):
stdin, stdout = setup_daemon() stdin, stdout = setup_daemon()
mock_setup_daemon.return_value = stdin, stdout mock_setup_daemon.return_value = stdin, stdout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment