def test_request_with_empty_dict_response(self): response = imagetickets.request(imagetickets.uhttp.DELETE, "uuid") self.assertEqual(response, {})
def test_request_with_response(self): ticket = create_ticket(uuid="uuid") data = json.dumps(ticket).encode("utf8") imagetickets.uhttp.response = FakeResponse(data=data) response = imagetickets.request(imagetickets.uhttp.GET, "uuid") self.assertEqual(response, ticket)
def test_request_with_response(self): ticket = create_ticket(uuid="uuid") data = json.dumps(ticket).encode("utf8") imagetickets.UnixHTTPConnection.response = FakeResponse(data=data) response = imagetickets.request("GET", "uuid") self.assertEqual(response, ticket)
def test_request_with_empty_dict_response(self): response = imagetickets.request("DELETE", "uuid") self.assertEqual(response, {})
def test_request_with_response(self): ticket = create_ticket(uuid="uuid") data = json.dumps(ticket).encode("utf8") imagetickets.uhttp.response = FakeResponse(data=data) response = imagetickets.request(imagetickets.uhttp.GET, "uuid") self.assertEqual(response, ticket)