def test_progress_updates(self): from txtorcon.torconfig import TorProcessProtocol self.got_progress = False; proto = TorProcessProtocol(None, functools.partial(self.confirm_progress, (10, 'tag', 'summary'))) proto.progress(10, 'tag', 'summary') self.assertTrue(self.got_progress)
def test_progress_updates(self): from txtorcon.torconfig import TorProcessProtocol self.got_progress = False proto = TorProcessProtocol( None, functools.partial(self.confirm_progress, (10, 'tag', 'summary'))) proto.progress(10, 'tag', 'summary') self.assertTrue(self.got_progress)
def test_progress_updates(self): self.got_progress = False def confirm_progress(p, t, s): self.assertEqual(p, 10) self.assertEqual(t, 'tag') self.assertEqual(s, 'summary') self.got_progress = True process = TorProcessProtocol(None, confirm_progress) process.progress(10, 'tag', 'summary') self.assertTrue(self.got_progress)
def test_tor_launch_success_then_shutdown(self): """ There was an error where we double-callbacked a deferred, i.e. success and then shutdown. This repeats it. """ process = TorProcessProtocol(None) process.status_client('STATUS_CLIENT BOOTSTRAP PROGRESS=100 TAG=foo SUMMARY=cabbage') self.assertEqual(None, process.connected_cb) class Value(object): exitCode = 123 class Status(object): value = Value() process.processEnded(Status()) self.assertEquals(len(self.flushLoggedErrors(RuntimeError)), 1)
def test_status_updates(self): from txtorcon.torconfig import TorProcessProtocol proto = TorProcessProtocol(None) proto.status_client("NOTICE CONSENSUS_ARRIVED")
def test_status_updates(self): process = TorProcessProtocol(None) process.status_client("NOTICE CONSENSUS_ARRIVED")