def test_state_change_is_processed_when_state_change_called(self, mock_card, mock_log, mock_unregister): ce = CardEvent(mock_card, 'state_change') ce.process() assert ce._state_change.called assert mock_card.called assert mock_log.info.called
def test_process_fails_when_non_existent_event(self, mock_card, mock_log): ce = CardEvent(mock_card, 'non_existent_event_type') ce.process() assert mock_log.error.called
def test_unregister_is_processed_when_unreg_called(self, mock_card, mock_log, mock_unregister): ce = CardEvent(mock_card, 'unregister') ce.process() assert ce._unregister.called assert mock_card.called assert mock_log.info.called