예제 #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)