def test_activate_wrong_status_raises(block_processor): # calling activate when not listening should raise chain_monitor = ChainMonitor([Queue(), Queue()], block_processor, bitcoind_feed_params) for status in ChainMonitorStatus: if status != ChainMonitorStatus.LISTENING: chain_monitor.status = status # mock the status with pytest.raises(RuntimeError, match="can only be called in LISTENING status"): chain_monitor.activate()
def test_monitor_chain_wrong_status_raises(block_processor): # calling monitor_chain when not idle should raise chain_monitor = ChainMonitor([Queue(), Queue()], block_processor, bitcoind_feed_params) for status in ChainMonitorStatus: if status != ChainMonitorStatus.IDLE: chain_monitor.status = status # mock the status with pytest.raises(RuntimeError, match="can only be called in IDLE status"): chain_monitor.monitor_chain()