def test_touchz(self): hdfs_client.touchz( path="/user/test/data.txt", executor=lambda cmd, *args: self._assert_command_generation("hadoop fs -touchz /user/test/data.txt")( cmd, *args ), )
def create_file(self, recursive=True): """ Creates a new empty file unless it already exists :param recursive: if True, will create parent folders """ if not self.exists(): if recursive and not self.base_dir().exists(): self.base_dir().create_directory(recursive) fs.touchz(self.path).if_failed_raise( FileSystemException( "Cannot create file '{path}'".format(path=self.path)))
def create_file(self, recursive=True): """ Creates a new empty file unless it already exists :param recursive: if True, will create parent folders """ if not self.exists(): if recursive and not self.base_dir().exists(): self.base_dir().create_directory(recursive) fs.touchz(self.path).if_failed_raise( FileSystemException("Cannot create file '{path}'".format(path=self.path)) )
def test_touchz(self): hdfs_client.touchz( path="/user/test/data.txt", executor=lambda cmd, *args: self._assert_command_generation( "hadoop fs -touchz /user/test/data.txt")(cmd, *args))