def test_function_getCotahistFilePaths_should_return_correct_file_paths(
         self):
     result = cotahist._get_cotahist_file_paths(
         fileutils.get_test_data_dir(__file__))
     assert len(result) == 2
     assert result == fileutils.get_test_data_files_path(
         __file__, ['COTAHIST_A0001.txt', 'COTAHIST_A0002.txt'])
 def test_should_load_each_dataFrame_with_correct_columns(self):
     expectedColumns = ['open', 'high', 'low', 'close', 'volume']
     d_dataFrame = cotahist.CotahistImporter(fileutils.get_test_data_dir(__file__)).getDataFrameMap()
     for s_stock in ['PETR3', 'PETR4']:
         columns = d_dataFrame[s_stock].columns
         for i in range(len(columns)):
             assert columns[i] == expectedColumns[i]
 def test_should_load_each_dataFrame_with_correct_columns(self):
     expectedColumns = ['open', 'high', 'low', 'close', 'volume']
     d_dataFrame = cotahist.CotahistImporter(
         fileutils.get_test_data_dir(__file__)).getDataFrameMap()
     for s_stock in ['PETR3', 'PETR4']:
         columns = d_dataFrame[s_stock].columns
         for i in range(len(columns)):
             assert columns[i] == expectedColumns[i]
    def test_should_load_each_dataFrame_with_correct_data(self):
        d_dataFrame = cotahist.CotahistImporter(fileutils.get_test_data_dir(__file__)).getDataFrameMap()

        df_petr4 = d_dataFrame['PETR4']
        self._assert_column_values(df_petr4['open'], [50.0, 50.16, 86.2])
        self._assert_column_values(df_petr4['high'], [50.45, 50.4, 88.4])
        self._assert_column_values(df_petr4['low'], [49.76, 48.01, 85.87])
        self._assert_column_values(df_petr4['close'], [50.45, 48.7, 88.4])
        self._assert_column_values(df_petr4['volume'], [5122400, 9949300, 13169600])
    def test_should_load_each_dataFrame_with_correct_data(self):
        d_dataFrame = cotahist.CotahistImporter(
            fileutils.get_test_data_dir(__file__)).getDataFrameMap()

        df_petr4 = d_dataFrame['PETR4']
        self._assert_column_values(df_petr4['open'], [50.0, 50.16, 86.2])
        self._assert_column_values(df_petr4['high'], [50.45, 50.4, 88.4])
        self._assert_column_values(df_petr4['low'], [49.76, 48.01, 85.87])
        self._assert_column_values(df_petr4['close'], [50.45, 48.7, 88.4])
        self._assert_column_values(df_petr4['volume'],
                                   [5122400, 9949300, 13169600])
 def test_should_load_each_dataFrame_with_5_columns(self):
     d_dataFrame = cotahist.CotahistImporter(fileutils.get_test_data_dir(__file__)).getDataFrameMap()
     for s_stock in ['PETR3', 'PETR4']:
         assert len(d_dataFrame[s_stock].columns) == 5
 def test_should_load_maps_with_dataFrames(self):
     d_dataFrame = cotahist.CotahistImporter(fileutils.get_test_data_dir(__file__)).getDataFrameMap()
     for value in [d_dataFrame[key] for key in d_dataFrame]:
         assert isinstance(value, pandas.DataFrame)
 def test_should_load_a_map_with_each_stock_paper_as_keys(self):
     d_dataFrame = cotahist.CotahistImporter(fileutils.get_test_data_dir(__file__)).getDataFrameMap()
     assert len(d_dataFrame.keys()) == 2
     for s_stock in ['PETR3', 'PETR4']:
         assert s_stock in d_dataFrame.keys()
 def test_function_getCotahistFilePaths_should_return_correct_file_paths(self):
     result = cotahist._get_cotahist_file_paths(fileutils.get_test_data_dir(__file__))
     assert len(result) == 2
     assert result == fileutils.get_test_data_files_path(__file__, ['COTAHIST_A0001.txt', 'COTAHIST_A0002.txt'])
 def test_function_getCotahistFilePaths_should_return_valid_paths(self):
     result = cotahist._get_cotahist_file_paths(fileutils.get_test_data_dir(__file__))
     for path in result:
         assert os.path.exists(path)
 def test_function_getCotahistFilePaths_should_return_list_of_paths(self):
     result = cotahist._get_cotahist_file_paths(fileutils.get_test_data_dir(__file__))
     assert isinstance(result, list)
 def test_function_getCotahistFilePaths_should_return_list_of_paths(self):
     result = cotahist._get_cotahist_file_paths(
         fileutils.get_test_data_dir(__file__))
     assert isinstance(result, list)
 def test_function_getCotahistFilePaths_should_return_valid_paths(self):
     result = cotahist._get_cotahist_file_paths(
         fileutils.get_test_data_dir(__file__))
     for path in result:
         assert os.path.exists(path)
 def test_should_load_each_dataFrame_with_5_columns(self):
     d_dataFrame = cotahist.CotahistImporter(
         fileutils.get_test_data_dir(__file__)).getDataFrameMap()
     for s_stock in ['PETR3', 'PETR4']:
         assert len(d_dataFrame[s_stock].columns) == 5
 def test_should_load_maps_with_dataFrames(self):
     d_dataFrame = cotahist.CotahistImporter(
         fileutils.get_test_data_dir(__file__)).getDataFrameMap()
     for value in [d_dataFrame[key] for key in d_dataFrame]:
         assert isinstance(value, pandas.DataFrame)
 def test_should_load_a_map_with_each_stock_paper_as_keys(self):
     d_dataFrame = cotahist.CotahistImporter(
         fileutils.get_test_data_dir(__file__)).getDataFrameMap()
     assert len(d_dataFrame.keys()) == 2
     for s_stock in ['PETR3', 'PETR4']:
         assert s_stock in d_dataFrame.keys()