예제 #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)
예제 #2
0
파일: hdfs.py 프로젝트: epam/Merlin
 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)
예제 #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
             ),
         )
     )
예제 #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),
     )
예제 #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)))
예제 #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))