def test_BaseClient_newpath(self): '''Test BaseClient.newpath()''' bc = BaseClient(uri.format(path='path')) self.assertEqual(bc.getpath(), BasePath(uri.format(path='path'))) self.assertEqual(bc.getpath('alternative/path'), BasePath(uri.format(path='alternative/path')))
def test_BasePath_root_property(self): self.assertTrue(BasePath(local_uri).root, '/')
def test_BasePath_owner(self): self.assertEqual(BasePath(local_uri).owner(), None)
def test_BasePath_is_symlink(self): '''Test BasePath.is_symlink()''' self.assertEqual(BasePath(local_uri).is_symlink(), False)
def test_BasePath_is_reserved(self): '''Test BasePath.is_reserved()''' self.assertEqual(BasePath(local_uri).is_reserved(), False)
def test_BasePath_is_dir(self): '''Test BasePath.is_dir()''' self.assertEqual(BasePath(local_uri).is_absolute(), True)
def test_BasePath_is_char_device(self): '''Test BasePath.is_char_device()''' self.assertEqual(BasePath(local_uri).is_char_device(), False)
def test_BasePath_with_block(self): '''Test with BasePath() block''' with BasePath(local_uri) as bc: self.assertIsInstance(bc, BasePath)
def test_BasePath_group(self): '''Test BasePath.group()''' self.assertEqual(BasePath(local_uri), None)
def test_BasePath_expanduser(self): '''Test BasePath.expanduser()''' path = local_uri.format(path='/var/~') self.assertEqual(BasePath(path).expanduser(), os.path.expanduser(path))
def test_BasePath_as_uri(self): '''Test BasePath.as_uri()''' self.assertEqual(BasePath(local_uri).as_uri(), local_uri)
def test_BasePath_as_posix(self): '''Test BasePath.as_posix()''' self.assertEqual(BasePath(local_uri).as_posix(), BasePath(local_uri))
def test_BasePath_absolute(self): '''Test BasePath.absolute()''' self.assertEqual(BasePath(local_uri).absolute(), BasePath(local_uri))
def test_BasePath_anchor_property(self): '''Test BasePath.anchor property''' self.assertEqual(BasePath(local_uri).anchor, '.')
def test_BasePath_query(self): '''Test BasePath.query property''' bp = BasePath('file://to/some/thing?query=True')
def samefile(self): self.assertTrue(BasePath(local_uri).samefile(local_uri))
def test_BasePath_home(self): '''Test BasePath.home()''' self.assertEqual(BasePath.home(), os.path.expanduser('~'))
def test_BasePath___init__(self): '''Test BasePath()''' bc = BasePath('', session=self.DummyClient) self.assertIsInstance(bc, BasePath)