summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian May <brian@linuxpenguins.xyz>2015-11-17 09:39:53 +1100
committerBrian May <brian@linuxpenguins.xyz>2015-11-17 09:39:53 +1100
commit641a193d3dc3b7aaf08ec1a28279d56760d64fa6 (patch)
treebeddecb6034b3af9b37e9d8169530365a3e256eb
parent71d17e449e2efd048c63c9a258e2c131322807a4 (diff)
Use readline instead of next.
-rw-r--r--sshuttle/tests/test_firewall.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/sshuttle/tests/test_firewall.py b/sshuttle/tests/test_firewall.py
index 47cd215..91a84a5 100644
--- a/sshuttle/tests/test_firewall.py
+++ b/sshuttle/tests/test_firewall.py
@@ -41,22 +41,22 @@ def test_rewrite_etc_hosts():
}
sshuttle.firewall.rewrite_etc_hosts(10)
with open("tmp/hosts") as f:
- line = f.next()
+ line = f.readline()
s = line.split()
assert s == ['1.2.3.3', 'existing']
- line = f.next()
+ line = f.readline()
s = line.split()
assert s == ['1.2.3.4', 'myhost',
'#', 'sshuttle-firewall-10', 'AUTOCREATED']
- line = f.next()
+ line = f.readline()
s = line.split()
assert s == ['1.2.3.5', 'myotherhost',
'#', 'sshuttle-firewall-10', 'AUTOCREATED']
- with pytest.raises(StopIteration):
- line = f.next()
+ line = f.readline()
+ assert line == ""
sshuttle.firewall.restore_etc_hosts(10)
assert filecmp.cmp("tmp/hosts.orig", "tmp/hosts", shallow=False) is True