def test_activity_exception(self, mock_emit_monitor_event):

        fake_logger = FakeLogger()
        self.activity_PostEIFBridge_with_log = activity_PostEIFBridge(settings_mock, fake_logger, None, None, None)

        data = test_data.PostEIFBridge_data(False, u'2012-12-13T00:00:00Z')

        #When
        success = self.activity_PostEIFBridge_with_log.do_activity(data)

        #Then
        self.assertRaises(Exception)
        self.assertEqual("Exception after submitting article EIF", fake_logger.logexception)

        mock_emit_monitor_event.assert_called_with(settings_mock, data["article_id"], data["version"], data["run"],
                                                   "Post EIF Bridge", "error",
                                                   "Error carrying over information after EIF For "
                                                   "article 00353 message:'NoneType' object has no "
                                                   "attribute 'get_queue'")

        self.assertEqual(False, success)
Exemple #2
0
    def test_activity_exception(self, mock_emit_monitor_event):

        fake_logger = FakeLogger()
        self.activity_PostEIFBridge_with_log = activity_PostEIFBridge(
            settings_mock, fake_logger, None, None, None)

        data = test_data.PostEIFBridge_data(False, u'2012-12-13T00:00:00Z')

        #When
        success = self.activity_PostEIFBridge_with_log.do_activity(data)

        #Then
        self.assertRaises(Exception)
        self.assertEqual("Exception after submitting article EIF",
                         fake_logger.logexception)

        mock_emit_monitor_event.assert_called_with(
            settings_mock, data["article_id"], data["version"], data["run"],
            "Post EIF Bridge", "error",
            "Error carrying over information after EIF For "
            "article 00353 message:'NoneType' object has no "
            "attribute 'get_queue'")

        self.assertEqual(False, success)
 def setUp(self):
     self.activity_PostEIFBridge = activity_PostEIFBridge(settings_mock, None, None, None, None)
Exemple #4
0
 def setUp(self):
     self.activity_PostEIFBridge = activity_PostEIFBridge(
         settings_mock, None, None, None, None)