# Path: pydoop/hdfs/common.py
# DEFAULT_PORT = 8020  # org/apache/hadoop/hdfs/server/namenode/NameNode.java
# 
# DEFAULT_USER = getpass.getuser()
# 
# Path: pydoop/test_utils.py
# UNI_CHR = _get_special_chr()


import os
import unittest
import tempfile
import pydoop.hdfs as hdfs
from numbers import Number
from pydoop.hdfs.common import DEFAULT_PORT, DEFAULT_USER
from pydoop.utils.misc import make_random_str
from pydoop.test_utils import UNI_CHR
            attr = getattr(s, n1, None)
            self.assertFalse(attr is None)
            self.assertEqual(attr, info[n2])
        self.__check_extra_args(s, info)
        self.__check_wrapper_funcs(p)
        hdfs.rm(p)

    def stat_on_local(self):
        wd_ = tempfile.mkdtemp(prefix='pydoop_', suffix=UNI_CHR)
        p_ = os.path.join(wd_, make_random_str())
        if hdfs.default_is_local():
            wd, p = wd_, p_
            host = "default"
        else:
            wd, p = ('file:%s' % _ for _ in (wd_, p_))
            host = ""
        fs = hdfs.hdfs(host, 0)
        with fs.open_file(p_, 'w') as fo:
            fo.write(b"foobar\n")
        info = fs.get_path_info(p_)
        fs.close()
        s = hdfs.path.stat(p)
        os_s = os.stat(p_)
        for n in dir(s):
            if n.startswith('st_'):
                try:
                    exp_v = getattr(os_s, n)
                except AttributeError:
                    try:
                        exp_v = info[self.NMAP[n]]

# Path: pydoop/hdfs/common.py
# DEFAULT_PORT = 8020  # org/apache/hadoop/hdfs/server/namenode/NameNode.java
# 
# DEFAULT_USER = getpass.getuser()
# 
# Path: pydoop/test_utils.py
# UNI_CHR = _get_special_chr()


# Path: test/hdfs/test_path.py
import os
import unittest
import tempfile
import pydoop.hdfs as hdfs
from numbers import Number
from pydoop.hdfs.common import DEFAULT_PORT, DEFAULT_USER
from pydoop.utils.misc import make_random_str
from pydoop.test_utils import UNI_CHR

            attr = getattr(s, n1, None)
            self.assertFalse(attr is None)
            self.assertEqual(attr, info[n2])
        self.__check_extra_args(s, info)
        self.__check_wrapper_funcs(p)
        hdfs.rm(p)

    def stat_on_local(self):
        wd_ = tempfile.mkdtemp(prefix='pydoop_', suffix=UNI_CHR)
        p_ = os.path.join(wd_, make_random_str())
        if hdfs.default_is_local():
            wd, p = wd_, p_
            host = "default"
        else:
            wd, p = ('file:%s' % _ for _ in (wd_, p_))
            host = ""
        fs = hdfs.hdfs(host, 0)
        with fs.open_file(p_, 'w') as fo:
            fo.write(b"foobar\n")
        info = fs.get_path_info(p_)
        fs.close()
        s = hdfs.path.stat(p)
        os_s = os.stat(p_)
        for n in dir(s):
            if n.startswith('st_'):
                try:
                    exp_v = getattr(os_s, n)
                except AttributeError:
                    try:
                        exp_v = info[self.NMAP[n]]

                    except KeyError: