def setUpClass(cls):
     super().setUpClass()
     constants.set_regtest()
Beispiel #2
0
                'check': lambda x: True,
                'connect': lambda x: True
            }
        })
        self.interface.q.put_nowait({
            'block_height': 5,
            'mock': {
                'catchup': 1,
                'check': lambda x: False,
                'connect': lambda x: True
            }
        })
        self.interface.q.put_nowait({
            'block_height': 6,
            'mock': {
                'catchup': 1,
                'check': lambda x: False,
                'connect': lambda x: True
            }
        })
        ifa = self.interface
        self.assertEqual(('catchup', 7),
                         asyncio.get_event_loop().run_until_complete(
                             ifa.sync_until(8, next_height=6)))
        self.assertEqual(self.interface.q.qsize(), 0)


if __name__ == "__main__":
    constants.set_regtest()
    unittest.main()