def test_auth_handling(self, loghub): current = Current() d = { "index": "http://l/some/index", "login": "******", } current.reconfigure(data=d) assert current.rooturl current.set_auth("user", "password") assert current.get_auth() == ("user", "password") # ok response d["authstatus"] = ["ok", "user"] current._configure_from_server_api(d, URL(current.rooturl)) assert current.get_auth() == ("user", "password") # invalidation response d["authstatus"] = ["nouser", "user"] current._configure_from_server_api(d, URL(current.rooturl)) assert not current.get_auth()