commit 2cf45fe30187284a86fa96f41372503028d87631 Author: Arturo Filastò art@fuffa.org Date: Sat Feb 1 12:22:57 2014 +0100
Call connectionLost to avoid dirty reactor. --- ooni/tests/test_txscapy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ooni/tests/test_txscapy.py b/ooni/tests/test_txscapy.py index 2f83b2d..5222e0c 100644 --- a/ooni/tests/test_txscapy.py +++ b/ooni/tests/test_txscapy.py @@ -4,16 +4,17 @@ from twisted.trial import unittest
from ooni.utils import txscapy
+defer.setDebugging(True) class TestTxScapy(unittest.TestCase): def setUp(self): # if not txscapy.hasRawSocketPermission(): # self.skipTest("No raw socket permissions...") mock_super_socket = MagicMock() - mock_super_socket.ins.fileno.return_value = 0 + mock_super_socket.ins.fileno.return_value = 1 self.scapy_factory = txscapy.ScapyFactory('foo', mock_super_socket)
def tearDown(self): - self.scapy_factory.loseConnection() + self.scapy_factory.connectionLost(None)
def test_pcapdnet_installed(self): assert txscapy.pcapdnet_installed() == True