def test_should_call_csv_reader_and_storage_engine(self, write_mock): batch_frames = [list(range(5))] * 2 # creates a dummy.csv create_sample_csv() file_path = 'dummy.csv' table_metainfo = 'info' batch_mem_size = 3000 file_options = {} file_options['file_format'] = FileFormatType.CSV column_list = [ TupleValueExpression(col_name='id', table_alias='dummy'), TupleValueExpression(col_name='frame_id', table_alias='dummy'), TupleValueExpression(col_name='video_id', table_alias='dummy') ] plan = type( "LoadDataPlan", (), { 'table_metainfo': table_metainfo, 'file_path': file_path, 'batch_mem_size': batch_mem_size, 'column_list': column_list, 'file_options': file_options }) load_executor = LoadDataExecutor(plan) batch = next(load_executor.exec()) write_mock.has_calls(call(table_metainfo, batch_frames[0]), call(table_metainfo, batch_frames[1])) # Note: We call exec() from the child classes. self.assertEqual( batch, Batch( pd.DataFrame([{ 'CSV': file_path, 'Number of loaded frames': 20 }]))) # remove the dummy.csv file_remove('dummy.csv')
def tearDown(self): file_remove('dummy.avi')
def tearDown(self): file_remove('dummy.csv')
def tearDown(self): file_remove("dummy.avi")
def tearDownClass(cls): file_remove('ua_detrac.mp4')
def tearDownClass(cls): file_remove("dummy.avi")
def tearDownClass(cls): file_remove('dummy.avi') file_remove('ua_detrac.mp4')