def test_send_ok_but_send_mq_failed(self, save_failed_message): mock_queue_publish_info = mock.Mock() mock_queue_publish_info.succeeded = False self.mock_message_queue_send.return_value = mock_queue_publish_info save_failed_message.return_value = None pm = PartnerManager( { 'ngas2-business-id': "1_proxy_basic_auth", 'ngas2-agreement-id': "A02", 'ngas2-data-dfs-path': "" }, "this is test message from tp_1" ) msg = pm.send() assert_not_equal(None, msg) assert_equal('successful', msg.message_status) assert_equal('successful', msg.message_mdn_status) assert_equal('successful', msg.message_mdn.mdn_validate_status)
def test_send_ok_with_download_cert(self, mock_os_path_exists, mock_dfs_download_to_file): mock_os_path_exists.side_effect = TestPartnerSendMessage.fake_os_path_exists mock_dfs_download_to_file.return_value = True pm = PartnerManager( { 'ngas2-business-id': "1", 'ngas2-agreement-id': "A01", 'ngas2-data-dfs-path': "" }, "this is test message from tp_1" ) msg = pm.send() assert_not_equal(None, msg) assert_equal('successful', msg.message_status) assert_equal('successful', msg.message_mdn_status) assert_equal('successful', msg.message_mdn.mdn_validate_status)