Пример #1
0
 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
         ),
     )
Пример #2
0
    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)))
Пример #3
0
    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))
            )
Пример #4
0
 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))