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