Beispiel #1
0
 def is_directory(self):
     """
     Tests whether a file is a directory.
     :rtype : bool
     :return: True if the file is a directory;
     False if the file does not exist, or file is not a directory
     """
     return fs.is_dir(self.path)
Beispiel #2
0
 def is_directory(self):
     """
     Tests whether a file is a directory.
     :rtype : bool
     :return: True if the file is a directory;
     False if the file does not exist, or file is not a directory
     """
     return fs.is_dir(self.path)
Beispiel #3
0
 def test_is_not_a_dir_command(self):
     self.assertFalse(
         hdfs_client.is_dir(
             "/tmp/data",
             executor=lambda cmd, *args: self._assert_command_generation("hadoop fs -test -d /tmp/data", status=-1)(
                 cmd, *args
             ),
         )
     )
Beispiel #4
0
 def test_is_dir_command_generator(self):
     hdfs_client.is_dir(
         "/tmp/data",
         executor=lambda cmd, *args: self._assert_command_generation("hadoop fs -test -d /tmp/data")(cmd, *args),
     )
Beispiel #5
0
 def test_is_not_a_dir_command(self):
     self.assertFalse(
         hdfs_client.is_dir(
             "/tmp/data",
             executor=lambda cmd, *args: self._assert_command_generation(
                 "hadoop fs -test -d /tmp/data", status=-1)(cmd, *args)))
Beispiel #6
0
 def test_is_dir_command_generator(self):
     hdfs_client.is_dir(
         "/tmp/data",
         executor=lambda cmd, *args: self._assert_command_generation(
             "hadoop fs -test -d /tmp/data")(cmd, *args))