Пример #1
0
 def get_matching_request_count(cls, request, parameters={}):
     cls.validate_is_entity(request, NearMissMatchPatternRequest)
     ids = {"id": "count"}
     response = cls.REST_CLIENT.post(
         cls.get_base_uri(cls.endpoint_single(), **ids), json=request.get_json_data(), headers=make_headers(), params=parameters
     )
     response = cls.REST_CLIENT.handle_response(response)
     return RequestCountResponse.from_dict(response.json())
 def test_request_count_response_deserialization(self):
     serialized = {"count": 1}
     e = RequestCountResponse.from_dict(serialized)
     self.assertIsInstance(e, RequestCountResponse)
     self.assertEquals(1, e.count)