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)
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 ), ) )
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), )
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)))
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))