[Pkg-anonymity-tools] [onionshare] 12/140: The code for Tails's firewall-punching was refactored without updating the tests. This updates the tests.

Ulrike Uhlig u-guest at moszumanska.debian.org
Mon Sep 29 20:33:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to branch master
in repository onionshare.

commit 925316339c2e09e2539fd1fa609ff0230584a916
Author: Mason Donahue <masond+github at gmail.com>
Date:   Sat Aug 23 16:57:28 2014 -0500

    The code for Tails's firewall-punching was refactored without updating the tests. This updates the tests.
---
 test/onionshare_test.py | 34 ----------------------------------
 1 file changed, 34 deletions(-)

diff --git a/test/onionshare_test.py b/test/onionshare_test.py
index 1e8e93d..a033321 100644
--- a/test/onionshare_test.py
+++ b/test/onionshare_test.py
@@ -21,40 +21,6 @@ class MockSubprocess():
   def last_call_args(self):
       return self.last_call
 
-def test_tails_open_port():
-    "tails_open_port() calls iptables with ACCEPT arg"
-    onionshare.get_platform = lambda: 'Tails'
-    onionshare.strings = {'punching_a_hole': ''}
-
-    mock_subprocess = MockSubprocess()
-    onionshare.subprocess = mock_subprocess
-    onionshare.tails_open_port('port')
-
-    expected_call = [
-        '/sbin/iptables', '-I', 'OUTPUT',
-        '-o', 'lo', '-p',
-        'tcp', '--dport', 'port', '-j', 'ACCEPT'
-        ]
-    actual_call = mock_subprocess.last_call_args()
-    assert actual_call == expected_call
-
-def test_tails_close_port():
-    "tails_close_port() calls iptables with REJECT arg"
-    onionshare.get_platform = lambda: 'Tails'
-    onionshare.strings = {'closing_hole': ''}
-
-    mock_subprocess = MockSubprocess()
-    onionshare.subprocess = mock_subprocess
-    onionshare.tails_close_port('port')
-
-    expected_call = [
-        '/sbin/iptables', '-I', 'OUTPUT',
-        '-o', 'lo', '-p',
-        'tcp', '--dport', 'port', '-j', 'REJECT'
-        ]
-    actual_call = mock_subprocess.last_call_args()
-    assert actual_call == expected_call
-
 def test_load_strings_defaults_to_english():
     "load_strings() loads English by default"
     locale.getdefaultlocale = lambda: ('en_US', 'UTF-8')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/onionshare.git



More information about the Pkg-anonymity-tools mailing list