MCPcopy Index your code
hub / github.com/sshuttle/sshuttle / test_rewrite_etc_hosts_no_overwrite

Function test_rewrite_etc_hosts_no_overwrite

tests/client/test_firewall.py:68–78  ·  view source on GitHub ↗
(mock_link, mock_rename, tmpdir)

Source from the content-addressed store, hash-verified

66@patch('os.link')
67@patch('os.rename')
68def test_rewrite_etc_hosts_no_overwrite(mock_link, mock_rename, tmpdir):
69 mock_link.side_effect = OSError
70 mock_rename.side_effect = OSError
71
72 with pytest.raises(OSError):
73 os.link('/test_from', '/test_to')
74
75 with pytest.raises(OSError):
76 os.rename('/test_from', '/test_to')
77
78 test_rewrite_etc_hosts(tmpdir)
79
80
81def test_subnet_weight():

Callers

nothing calls this directly

Calls 1

test_rewrite_etc_hostsFunction · 0.85

Tested by

no test coverage detected