def test_on_failure(self): actor = lib.IRControlFrontend(self.config, None) actor.on_start() actor.on_failure() assert not actor.thread.isAlive()
def test_on_start_log_exception(self, mock_logger): actor = lib.IRControlFrontend(self.config, None) with patch('mopidy_IRControl.actor.LircThread.start') as MockMethod: MockMethod.side_effect = Exception('Boom!') actor.on_start() self.assertTrue(mock_logger.warning.called)
def test_on_start_should_spawn_thread(self): actor = lib.IRControlFrontend(self.config, None) actor.on_start() assert actor.thread is not None