def set_up(source_file_path, target_file_type, mode): target_file_path = get_target_file_path(target_file_type, source_file_path) if not CSVOperations.check_file_exists(source_file_path): print(source_file_path) raise MappingFileNotFound( 'Mapping File Not Found at' + source_file_path, source_file_path) if CSVOperations.check_file_exists( target_file_path) and mode != Mode.APPEND: CSVOperations.delete_file(target_file_path) if not CSVOperations.check_file_exists(target_file_path): CSVOperations.create_file(target_file_path, target_file_type)
def test_created_file_exists(self): self.__create_individual_file() self.assertTrue(csvops.check_file_exists(self.test_file_path))
def test_file_delete(self): csvops.create_file(self.test_file_path, TargetCSVType.INDIVIDUAL) csvops.delete_file(self.test_file_path) self.assertFalse(csvops.check_file_exists(self.test_file_path))
def test_file_does_not_exist(self): self.assertFalse(csvops.check_file_exists(self.test_file_path))