()
| 41 | |
| 42 | @staticmethod |
| 43 | def gen_mock_data() -> (str, str): |
| 44 | mock_data_list = [ |
| 45 | 'Title,Content,Label', 'mock title1,mock content1,mock label1', |
| 46 | 'mock title2,mock content2,mock label2', |
| 47 | 'mock title3,mock content3,mock label3' |
| 48 | ] |
| 49 | |
| 50 | mock_file_name = 'mock_file.csv' |
| 51 | md = hashlib.md5() |
| 52 | md.update('GenLocalFile.gen_mock_data.out_file_path'.encode('utf-8')) |
| 53 | mock_dir = os.path.join(os.getcwd(), md.hexdigest()) |
| 54 | os.makedirs(mock_dir, exist_ok=True) |
| 55 | mock_relative_path = os.path.join(md.hexdigest(), mock_file_name) |
| 56 | with open(mock_relative_path, 'w') as f: |
| 57 | for line in mock_data_list: |
| 58 | f.write(line + '\n') |
| 59 | |
| 60 | return mock_relative_path, md.hexdigest() |
| 61 | |
| 62 | @staticmethod |
| 63 | def clear_mock_dir(mock_dir) -> None: |
no test coverage detected