Пример #1
0
    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')))
Пример #2
0
 def test_BasePath_root_property(self):
     self.assertTrue(BasePath(local_uri).root, '/')
Пример #3
0
 def test_BasePath_owner(self):
     self.assertEqual(BasePath(local_uri).owner(), None)
Пример #4
0
 def test_BasePath_is_symlink(self):
     '''Test BasePath.is_symlink()'''
     self.assertEqual(BasePath(local_uri).is_symlink(), False)
Пример #5
0
 def test_BasePath_is_reserved(self):
     '''Test BasePath.is_reserved()'''
     self.assertEqual(BasePath(local_uri).is_reserved(), False)
Пример #6
0
 def test_BasePath_is_dir(self):
     '''Test BasePath.is_dir()'''
     self.assertEqual(BasePath(local_uri).is_absolute(), True)
Пример #7
0
 def test_BasePath_is_char_device(self):
     '''Test BasePath.is_char_device()'''
     self.assertEqual(BasePath(local_uri).is_char_device(), False)
Пример #8
0
 def test_BasePath_with_block(self):
     '''Test with BasePath() block'''
     with BasePath(local_uri) as bc:
         self.assertIsInstance(bc, BasePath)
Пример #9
0
 def test_BasePath_group(self):
     '''Test BasePath.group()'''
     self.assertEqual(BasePath(local_uri), None)
Пример #10
0
 def test_BasePath_expanduser(self):
     '''Test BasePath.expanduser()'''
     path = local_uri.format(path='/var/~')
     self.assertEqual(BasePath(path).expanduser(), os.path.expanduser(path))
Пример #11
0
 def test_BasePath_as_uri(self):
     '''Test BasePath.as_uri()'''
     self.assertEqual(BasePath(local_uri).as_uri(), local_uri)
Пример #12
0
 def test_BasePath_as_posix(self):
     '''Test BasePath.as_posix()'''
     self.assertEqual(BasePath(local_uri).as_posix(), BasePath(local_uri))
Пример #13
0
 def test_BasePath_absolute(self):
     '''Test BasePath.absolute()'''
     self.assertEqual(BasePath(local_uri).absolute(), BasePath(local_uri))
Пример #14
0
 def test_BasePath_anchor_property(self):
     '''Test BasePath.anchor property'''
     self.assertEqual(BasePath(local_uri).anchor, '.')
Пример #15
0
 def test_BasePath_query(self):
     '''Test BasePath.query property'''
     bp = BasePath('file://to/some/thing?query=True')
Пример #16
0
 def samefile(self):
     self.assertTrue(BasePath(local_uri).samefile(local_uri))
Пример #17
0
 def test_BasePath_home(self):
     '''Test BasePath.home()'''
     self.assertEqual(BasePath.home(), os.path.expanduser('~'))
Пример #18
0
 def test_BasePath___init__(self):
     '''Test BasePath()'''
     bc = BasePath('', session=self.DummyClient)
     self.assertIsInstance(bc, BasePath)