import unittest
from datetime import datetime
from unittest import mock

from eveapimongo import ApiWrapper, MongoProvider
from functions.transactionParser.transactionParser import TransactionParser


class TestTransactionParser(unittest.TestCase):
    def setUp(self):
        self.sut = TransactionParser()

    def test_handle_error_no_errors_before(self):
        # test data
        expected = {'corpId': 123456, 'corpName': 'Test Corp', 'failCount': 1}

        # mocking
        find_method = mock.patch.object(MongoProvider, 'find_one',
                                        return_value={'corpId': 123456, 'corpName': 'Test Corp'}).start()
        update_method = mock.patch.object(self.sut, 'update_corp').start()