Пример #1
0
 def test_loginout(self):
     con = Connection('http://0.0.0.0:3333')
     con.login('*****@*****.**', 'test')
     self.assertIsNotNone(con.token)
     con.logout()
     self.assertIsNone(con.token)
     self.assertRaisesRegex(BaseError, 'KNORA-ERROR: status code=400*', con.login, 'invalid', 'invalid')
Пример #2
0
 def test_get(self):
     con = Connection('http://0.0.0.0:3333')
     res = con.get("/ontology/0001/anything/simple/v2")
     con.logout()
     self.assertIsNotNone(res['@graph'])
     self.assertRaises(BaseError, con.get, "/gagaga")