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_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')
def test_BaseClient_unlink(self): '''Test BaseClient.unline()''' with self.assertRaises(NotImplementedError): BaseClient('https://localhost').unlink()
def test_BaseClient_rename(self): '''Test BaseClient.rename()''' with self.assertRaises(NotImplementedError): BaseClient('https://localhost').rename()
def test_BaseClient_lchmod(self): '''Test BaseClient.lchmod()''' with self.assertRaises(NotImplementedError): BaseClient('https://localhost').lchmod('path', 0o777)
def test_BaseClient_chmod(self): with self.assertRaises(NotImplementedError): BaseClient('https://localhost').chmod('path', 0o777)
def test_BaseClient_scandir(self): '''Test BaseClient.scandir()''' with self.assertRaises(NotImplementedError): BaseClient('https://localhost').scandir()
def test_BaseClient_open(self): '''Test BaseClient.open()''' with self.assertRaises(NotImplementedError): BaseClient('').open('path')
def test_BaseClient_makedirs(self): '''Test BaseClient.makedirs()''' with self.assertRaises(NotImplementedError): BaseClient('https://localhost').makedirs()