def handle_goodbye(signum, frame): print("Signing out!") payload = { 'username': config["username"], 'password': config["password"] } try: authentication._make_request(authentication.AUTH_SERVER, "signout", payload) except: print("Failed to sign out with Yggdrasil") finally: sys.exit()
def test_make_request_json_dump(self): data = { "Marie": "McGee", "George": 1, "Nestly": {"Nestling": "Nestling's tail"}, "Listly": ["listling1", 2, "listling 3"], } req = _make_request(AUTHSERVER, "authenticate", data) self.assertEqual(req.request.body, json.dumps(data))
def test_make_request_json_dump(self): data = {"Marie": "McGee", "George": 1, "Nestly": { "Nestling": "Nestling's tail" }, "Listly": ["listling1", 2, "listling 3"] } res = _make_request(AUTHSERVER, "authenticate", data) self.assertEqual(res.request.body, json.dumps(data))
def test_make_request_url(self): URL = "https://authserver.mojang.com/authenticate" req = _make_request(AUTHSERVER, "authenticate", {"Darling": "Diary"}) self.assertEqual(req.request.url, URL)
def test_make_request_http_method(self): req = _make_request(AUTHSERVER, "authenticate", {"Billy": "Bob"}) self.assertEqual(req.request.method, "POST")