commit b7430b6271da4afa0936debbedbb3c3208088d71 Author: Arturo Filastò art@fuffa.org Date: Fri Jan 31 18:56:36 2014 +0100
Pass the mock super socket in the ScapyFactory constructor --- ooni/tests/test_txscapy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ooni/tests/test_txscapy.py b/ooni/tests/test_txscapy.py index 337c399..2f83b2d 100644 --- a/ooni/tests/test_txscapy.py +++ b/ooni/tests/test_txscapy.py @@ -8,9 +8,9 @@ class TestTxScapy(unittest.TestCase): def setUp(self): # if not txscapy.hasRawSocketPermission(): # self.skipTest("No raw socket permissions...") - self.scapy_factory = txscapy.ScapyFactory('auto') - self.scapy_factory.super_socket = MagicMock() - self.scapy_factory.super_socket.ins.fileno.return_value = -1 + mock_super_socket = MagicMock() + mock_super_socket.ins.fileno.return_value = 0 + self.scapy_factory = txscapy.ScapyFactory('foo', mock_super_socket)
def tearDown(self): self.scapy_factory.loseConnection()
tor-commits@lists.torproject.org