Lines Matching defs:Model
17 """JSON Model tests
19 Unit tests for the JSON model.
31 import googleapiclient.model
35 from googleapiclient.model import JsonModel
40 class Model(unittest.TestCase):
42 model = JsonModel(data_wrapper=False)
49 headers, unused_params, query, body = model.request(
58 model = JsonModel(data_wrapper=False)
65 headers, unused_params, query, body = model.request(
74 model = JsonModel(data_wrapper=True)
81 headers, unused_params, query, body = model.request(
91 model = JsonModel(data_wrapper=True)
98 headers, unused_params, query, body = model.request(
107 model = JsonModel(data_wrapper=False)
116 headers, unused_params, query, body = model.request(
135 model = JsonModel(data_wrapper=False)
142 headers, unused_params, unused_query, body = model.request(
150 model = JsonModel(data_wrapper=False)
156 content = model.response(resp, content)
164 content = model.response(resp, content)
170 model = JsonModel(data_wrapper=True)
175 content = model.response(resp, content)
179 model = JsonModel(data_wrapper=False)
184 content = model.response(resp, content)
188 model = JsonModel(data_wrapper=False)
193 content = model.response(resp, content)
197 model = JsonModel(data_wrapper=False)
202 content = model.response(resp, content)
222 old_logging = googleapiclient.model.LOGGER
223 googleapiclient.model.LOGGER = MockLogging()
224 googleapiclient.model.dump_request_response = True
225 model = JsonModel()
230 body_string = model.request({}, {}, {}, request_body)[-1]
237 response_body = model.response(MockResponse(response), body_string)
239 self.assertEqual(googleapiclient.model.LOGGER.info_record[:2],
243 googleapiclient.model.LOGGER.info_record)
245 googleapiclient.model.LOGGER.info_record)
246 self.assertEqual(json.loads(googleapiclient.model.LOGGER.info_record[-2]),
248 self.assertEqual(googleapiclient.model.LOGGER.info_record[-1],
250 googleapiclient.model.LOGGER = old_logging
253 model = JsonModel(data_wrapper=False)
257 content = model.response(resp, content)
261 model = JsonModel(data_wrapper=True)
265 content = model.response(resp, content)
269 model = JsonModel(data_wrapper=True)
273 content = model.response(resp, content)