def test_render_event_name__accepts_many_finalizers(self): assert CreateOrRead('Car').render_event_name( Mock(), EventFactory.Created()) == 'CAR_CREATED' assert CreateOrRead('Box').render_event_name( Mock(), EventFactory.Read()) == 'BOX_READ'
def test_render_event_name__wrong_finalizer(self): try: assert Execute('Get', 'Car').render_event_name(Mock(), EventFactory.Created()) except EventFactory.BrokenRequest as e: assert e.event == ( 'INVALID_FINALIZER_USED_FOR_SPECIFIC_COMMAND_DETECTED')