Esempio n. 1
0
import unittest
from isharp.datahub.core import DataBroker, MatrixHeader, Matrix, AcquireContentReturnValue, Revision
from unittest.mock import MagicMock
from unittest.mock import patch
from isharp.datahub.core import StorageMethod
from datetime import datetime
from isharp.datahub.core import RevisionInfo
from isharp.datahub.core import AbstractDataBroker
import pandas as pd

test_header = MatrixHeader(name="hello",
                           revision_id=5,
                           storage_method="test",
                           path=".",
                           memory_style=None,
                           description="None")
test_content = pd.DataFrame(data={
    'col1': [1],
    'col2': [2]
},
                            index=['2019-01-01'])
time_now = datetime.now()

test_revision = Revision("abc", RevisionInfo("who", "what", time_now))


class TestAbstractBroker(unittest.TestCase):
    @patch.multiple(StorageMethod, __abstractmethods__=set())
    def setUp(self):
        self.mock_storage_method = StorageMethod("test")
        self.broker = AbstractDataBroker(self.mock_storage_method)