Пример #1
0
 def __init__(self, response, resource_name=None, model_builder=None):
     self.resource_name = resource_name
     self.raw = response
     if response.text:
         self.json = response.json()
         self.full_json = self.json
         if model_builder and resource_name:
             self.model = model_builder(self.json, resource_name)
         if resource_name:
             # fixme Remove unwrapping
             self.json = util.unwrap(self.json, resource_name)
         logging.debug("Got JSON response with status code `%s`", response.status_code)
Пример #2
0
def test_unwrap():
    result = util.unwrap({'flowInstance': mock_json}, 'flow-instance')

    assert_that(result, equal_to(mock_json))