Exemplo n.º 1
0
    def test_manifest_received_triggered(self):
        message = self.create_fake_generic_manifest_message(EVENT_MAN_RECEIVED)
        rule = Rule(env='test', config='test', message=message)

        rule._on_manifest_create = Mock()
        rule._on_manifest_received = Mock()
        rule._on_work_order_event = Mock()
        rule._on_catalogue_new = Mock()
        rule._on_catalogue_processed = Mock()
        rule._on_catalogue_rejected = Mock()

        rule.check_rules()

        rule._on_manifest_create.assert_not_called()
        rule._on_manifest_received.assert_called_once()
        rule._on_work_order_event.assert_not_called()
        rule._on_catalogue_new.assert_not_called()
        rule._on_catalogue_processed.assert_not_called()
        rule._on_catalogue_rejected.assert_not_called()
Exemplo n.º 2
0
    def test_work_order_concluded_event_triggered(self):
        drs_study_code = 1234
        message = self.create_fake_generic_work_order_message(
            EVENT_WO_CONCLUDED, drs_study_code)
        rule = Rule(env='test', config='test', message=message)

        rule._on_manifest_create = Mock()
        rule._on_manifest_received = Mock()
        rule._on_work_order_event = Mock()
        rule._on_catalogue_new = Mock()
        rule._on_catalogue_processed = Mock()
        rule._on_catalogue_rejected = Mock()

        rule.check_rules()

        rule._on_manifest_create.assert_not_called()
        rule._on_manifest_received.assert_not_called()
        rule._on_work_order_event.assert_called_once()
        rule._on_catalogue_new.assert_not_called()
        rule._on_catalogue_processed.assert_not_called()
        rule._on_catalogue_rejected.assert_not_called()