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 setUp(self): self.db = FakeFluidDB() self.api = FluidApi(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')