Example #1
0
    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)
Example #2
0
    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)
Example #3
0
    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)