Esempio n. 1
0
    def test_file_utils_get_same_code_files(self):
        path = self.cfg_provider.get_tdx_stock_directory_path(
            StockDataType.ONE_MIN, 'sh')
        print(path)
        path1 = FileUtils.convert_file_path_based_on_system(path)
        sh_files = FileUtils.get_all_files(path1)
        path = self.cfg_provider.get_tdx_stock_directory_path(
            StockDataType.ONE_MIN, 'sz')
        path2 = FileUtils.convert_file_path_based_on_system(path)
        sz_files = FileUtils.get_all_files(path2)

        sh_file_codes = {}
        sz_file_codes = {}
        for f in sh_files:
            f_code = f.split(".lc1")[0].split("sh")[1]
            sh_file_codes[f_code] = True
        for f in sz_files:
            f_code = f.split(".lc1")[0].split("sz")[1]
            sz_file_codes[f_code] = True

        for key, _ in sh_file_codes.items():
            if key in sz_file_codes:
                print(f'both exist: {key}')
Esempio n. 2
0
 def test_file_utils(self):
     path = self.cfg_provider.get_tdx_stock_directory_path(
         StockDataType.ONE_MIN, 'sh')
     print(path)
     path = FileUtils.convert_file_path_based_on_system(path)
     self.logger.debug(FileUtils.get_all_files(path))