# 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
                p = '%s%s' % (pre, rest)
                self.assertEqual(hdfs.path.expanduser(p), p)

    def expandvars(self):
        k, v = 'PYDOOP_TEST_K', 'PYDOOP_TEST_V'
        p = 'hdfs://host:1/${%s}' % k
        os.environ[k] = v
        exp_res = '%s/%s' % (p.rsplit('/', 1)[0], v)
        try:
            self.assertEqual(hdfs.path.expandvars(p), exp_res)
        finally:
            del os.environ[k]


class TestStat(unittest.TestCase):

    NMAP = {
        'st_mode': 'permissions',
        'st_uid': 'owner',
        'st_gid': 'group',
        'st_size': 'size',
        'st_atime': 'last_access',
        'st_mtime': 'last_mod',
        'st_blksize': 'block_size',
    }

    def stat(self):
        if hdfs.default_is_local():
            return
        bn = '%s%s' % (make_random_str(), UNI_CHR)

# 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

                p = '%s%s' % (pre, rest)
                self.assertEqual(hdfs.path.expanduser(p), p)

    def expandvars(self):
        k, v = 'PYDOOP_TEST_K', 'PYDOOP_TEST_V'
        p = 'hdfs://host:1/${%s}' % k
        os.environ[k] = v
        exp_res = '%s/%s' % (p.rsplit('/', 1)[0], v)
        try:
            self.assertEqual(hdfs.path.expandvars(p), exp_res)
        finally:
            del os.environ[k]


class TestStat(unittest.TestCase):

    NMAP = {
        'st_mode': 'permissions',
        'st_uid': 'owner',
        'st_gid': 'group',
        'st_size': 'size',
        'st_atime': 'last_access',
        'st_mtime': 'last_mod',
        'st_blksize': 'block_size',
    }

    def stat(self):
        if hdfs.default_is_local():
            return
        bn = '%s%s' % (make_random_str(), UNI_CHR)

        fn = '/user/%s/%s' % (DEFAULT_USER, bn)