Esempio n. 1
0
 def test_request_with_empty_dict_response(self):
     response = imagetickets.request(imagetickets.uhttp.DELETE, "uuid")
     self.assertEqual(response, {})
Esempio n. 2
0
 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)
Esempio n. 3
0
 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)
Esempio n. 4
0
 def test_request_with_empty_dict_response(self):
     response = imagetickets.request("DELETE", "uuid")
     self.assertEqual(response, {})
Esempio n. 5
0
 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)