def testLogin(self): fdb = FluidApi(self.db) self.db.login('test', 'test') resp = yield fdb.namespaces['test'].put( description='Test user namespace') self.assertEqual(resp.status, 204) self.assertEqual(resp.content, '')
def __init__(self, base_url=BASE_URL): FluidApi.__init__(self, FluidDB(base_url))
def setUp(self): self.db = FakeFluidDB() self.api = FluidApi(self.db)
def __init__(self, base_url=None): if base_url is not None: db = FluidDB(base_url) else: db = FluidDB() FluidApi.__init__(self, db)
def testError(self): fdb = FluidApi(self.db) d = fdb.namespaces['test'].put(description='Oh deary') return self.assertFailure(d, errors.Fluid401Error)
def testApi(self): fdb = FluidApi(self.db) resp = yield fdb.users['test'].get() self.assertEqual(resp.value[u'name'], 'test')