Пример #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_BaseClient___init__(self):
        '''Test BaseClient()'''
        bc = BaseClient(uri.format(path='path'))
        self.assertEqual(bc.username, 'test')
        self.assertEqual(bc.password, 'pass')
        self.assertEqual(bc.hostname, 'localhost')
        self.assertEqual(bc.port, 63197)
        self.assertEqual(bc.path, 'path')
        self.assertEqual(bc.netloc, 'test:pass@localhost:63197')
        self.assertEqual(bc.query, 'testing=true&stuff=hello%20world&a=null')
        self.assertEqual(bc.testing, True)
        self.assertEqual(bc.stuff, 'hello world')
        self.assertEqual(bc.a, None)

        bc = BaseClient(uri.format(path='path') + '&path=/to/somewhere/else',
                        testing=False,
                        path='alternative/path')
        self.assertEqual(bc.testing, False)
        self.assertEqual(bc.path, 'alternative/path')
        self.assertEqual(getattr(bc, 'path_', None), '/to/somewhere/else')
Пример #3
0
 def test_BaseClient_unlink(self):
     '''Test BaseClient.unline()'''
     with self.assertRaises(NotImplementedError):
         BaseClient('https://localhost').unlink()
Пример #4
0
 def test_BaseClient_rename(self):
     '''Test BaseClient.rename()'''
     with self.assertRaises(NotImplementedError):
         BaseClient('https://localhost').rename()
Пример #5
0
 def test_BaseClient_lchmod(self):
     '''Test BaseClient.lchmod()'''
     with self.assertRaises(NotImplementedError):
         BaseClient('https://localhost').lchmod('path', 0o777)
Пример #6
0
 def test_BaseClient_chmod(self):
     with self.assertRaises(NotImplementedError):
         BaseClient('https://localhost').chmod('path', 0o777)
Пример #7
0
 def test_BaseClient_scandir(self):
     '''Test BaseClient.scandir()'''
     with self.assertRaises(NotImplementedError):
         BaseClient('https://localhost').scandir()
Пример #8
0
 def test_BaseClient_open(self):
     '''Test BaseClient.open()'''
     with self.assertRaises(NotImplementedError):
         BaseClient('').open('path')
Пример #9
0
 def test_BaseClient_makedirs(self):
     '''Test BaseClient.makedirs()'''
     with self.assertRaises(NotImplementedError):
         BaseClient('https://localhost').makedirs()