Craig Citro | 15744b1 | 2015-03-02 13:34:32 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 2 | # |
Craig Citro | 751b7fb | 2014-09-23 11:20:38 -0700 | [diff] [blame] | 3 | # Copyright 2014 Google Inc. All Rights Reserved. |
Joe Gregorio | 6d5e94f | 2010-08-25 23:49:30 -0400 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 16 | |
Joe Gregorio | 6d5e94f | 2010-08-25 23:49:30 -0400 | [diff] [blame] | 17 | """JSON Model tests |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 18 | |
Joe Gregorio | 6d5e94f | 2010-08-25 23:49:30 -0400 | [diff] [blame] | 19 | Unit tests for the JSON model. |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 20 | """ |
INADA Naoki | d898a37 | 2015-03-04 03:52:46 +0900 | [diff] [blame] | 21 | from __future__ import absolute_import |
| 22 | import six |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 23 | |
| 24 | __author__ = 'jcgregorio@google.com (Joe Gregorio)' |
| 25 | |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 26 | import copy |
Craig Citro | 6ae34d7 | 2014-08-18 23:10:09 -0700 | [diff] [blame] | 27 | import json |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 28 | import os |
Bu Sun Kim | 07f647c | 2019-08-09 14:55:24 -0700 | [diff] [blame] | 29 | import platform |
Pat Ferate | 497a90f | 2015-03-09 09:52:54 -0700 | [diff] [blame] | 30 | import unittest2 as unittest |
Joe Gregorio | c5c5a37 | 2010-09-22 11:42:32 -0400 | [diff] [blame] | 31 | import httplib2 |
John Asmuth | 864311d | 2014-04-24 15:46:08 -0400 | [diff] [blame] | 32 | import googleapiclient.model |
ade@google.com | d69e5e4 | 2010-08-31 15:28:20 +0100 | [diff] [blame] | 33 | |
John Asmuth | 864311d | 2014-04-24 15:46:08 -0400 | [diff] [blame] | 34 | from googleapiclient import __version__ |
| 35 | from googleapiclient.errors import HttpError |
| 36 | from googleapiclient.model import JsonModel |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 37 | |
Pat Ferate | d5b61bd | 2015-03-03 16:04:11 -0800 | [diff] [blame] | 38 | from six.moves.urllib.parse import parse_qs |
ade@google.com | d69e5e4 | 2010-08-31 15:28:20 +0100 | [diff] [blame] | 39 | |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 40 | |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 41 | class Model(unittest.TestCase): |
| 42 | def test_json_no_body(self): |
Joe Gregorio | d433b2a | 2011-02-22 10:51:51 -0500 | [diff] [blame] | 43 | model = JsonModel(data_wrapper=False) |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 44 | |
| 45 | headers = {} |
ade@google.com | 850cf55 | 2010-08-20 23:24:56 +0100 | [diff] [blame] | 46 | path_params = {} |
| 47 | query_params = {} |
| 48 | body = None |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 49 | |
Joe Gregorio | 5a4c328 | 2013-07-29 13:48:06 -0400 | [diff] [blame] | 50 | headers, unused_params, query, body = model.request( |
Joe Gregorio | a314b1f | 2013-04-05 16:25:11 -0400 | [diff] [blame] | 51 | headers, path_params, query_params, body) |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 52 | |
| 53 | self.assertEqual(headers['accept'], 'application/json') |
| 54 | self.assertTrue('content-type' not in headers) |
| 55 | self.assertNotEqual(query, '') |
| 56 | self.assertEqual(body, None) |
| 57 | |
| 58 | def test_json_body(self): |
Joe Gregorio | d433b2a | 2011-02-22 10:51:51 -0500 | [diff] [blame] | 59 | model = JsonModel(data_wrapper=False) |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 60 | |
| 61 | headers = {} |
ade@google.com | 850cf55 | 2010-08-20 23:24:56 +0100 | [diff] [blame] | 62 | path_params = {} |
| 63 | query_params = {} |
| 64 | body = {} |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 65 | |
Joe Gregorio | 5a4c328 | 2013-07-29 13:48:06 -0400 | [diff] [blame] | 66 | headers, unused_params, query, body = model.request( |
Joe Gregorio | a314b1f | 2013-04-05 16:25:11 -0400 | [diff] [blame] | 67 | headers, path_params, query_params, body) |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 68 | |
| 69 | self.assertEqual(headers['accept'], 'application/json') |
| 70 | self.assertEqual(headers['content-type'], 'application/json') |
| 71 | self.assertNotEqual(query, '') |
Joe Gregorio | 913e70d | 2010-11-05 15:38:23 -0400 | [diff] [blame] | 72 | self.assertEqual(body, '{}') |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 73 | |
Joe Gregorio | d433b2a | 2011-02-22 10:51:51 -0500 | [diff] [blame] | 74 | def test_json_body_data_wrapper(self): |
| 75 | model = JsonModel(data_wrapper=True) |
| 76 | |
| 77 | headers = {} |
| 78 | path_params = {} |
| 79 | query_params = {} |
| 80 | body = {} |
| 81 | |
Joe Gregorio | 5a4c328 | 2013-07-29 13:48:06 -0400 | [diff] [blame] | 82 | headers, unused_params, query, body = model.request( |
Joe Gregorio | a314b1f | 2013-04-05 16:25:11 -0400 | [diff] [blame] | 83 | headers, path_params, query_params, body) |
Joe Gregorio | d433b2a | 2011-02-22 10:51:51 -0500 | [diff] [blame] | 84 | |
| 85 | self.assertEqual(headers['accept'], 'application/json') |
| 86 | self.assertEqual(headers['content-type'], 'application/json') |
| 87 | self.assertNotEqual(query, '') |
| 88 | self.assertEqual(body, '{"data": {}}') |
| 89 | |
Joe Gregorio | 8963ff9 | 2010-10-11 13:14:43 -0400 | [diff] [blame] | 90 | def test_json_body_default_data(self): |
| 91 | """Test that a 'data' wrapper doesn't get added if one is already present.""" |
Joe Gregorio | d433b2a | 2011-02-22 10:51:51 -0500 | [diff] [blame] | 92 | model = JsonModel(data_wrapper=True) |
Joe Gregorio | 8963ff9 | 2010-10-11 13:14:43 -0400 | [diff] [blame] | 93 | |
| 94 | headers = {} |
| 95 | path_params = {} |
| 96 | query_params = {} |
| 97 | body = {'data': 'foo'} |
| 98 | |
Joe Gregorio | 5a4c328 | 2013-07-29 13:48:06 -0400 | [diff] [blame] | 99 | headers, unused_params, query, body = model.request( |
Joe Gregorio | a314b1f | 2013-04-05 16:25:11 -0400 | [diff] [blame] | 100 | headers, path_params, query_params, body) |
Joe Gregorio | 8963ff9 | 2010-10-11 13:14:43 -0400 | [diff] [blame] | 101 | |
| 102 | self.assertEqual(headers['accept'], 'application/json') |
| 103 | self.assertEqual(headers['content-type'], 'application/json') |
| 104 | self.assertNotEqual(query, '') |
| 105 | self.assertEqual(body, '{"data": "foo"}') |
| 106 | |
Joe Gregorio | fe695fb | 2010-08-30 12:04:04 -0400 | [diff] [blame] | 107 | def test_json_build_query(self): |
Joe Gregorio | d433b2a | 2011-02-22 10:51:51 -0500 | [diff] [blame] | 108 | model = JsonModel(data_wrapper=False) |
Joe Gregorio | fe695fb | 2010-08-30 12:04:04 -0400 | [diff] [blame] | 109 | |
| 110 | headers = {} |
| 111 | path_params = {} |
Joe Gregorio | 61d7e96 | 2011-02-22 22:52:07 -0500 | [diff] [blame] | 112 | query_params = {'foo': 1, 'bar': u'\N{COMET}', |
| 113 | 'baz': ['fe', 'fi', 'fo', 'fum'], # Repeated parameters |
| 114 | 'qux': []} |
Joe Gregorio | fe695fb | 2010-08-30 12:04:04 -0400 | [diff] [blame] | 115 | body = {} |
| 116 | |
Joe Gregorio | 5a4c328 | 2013-07-29 13:48:06 -0400 | [diff] [blame] | 117 | headers, unused_params, query, body = model.request( |
Joe Gregorio | a314b1f | 2013-04-05 16:25:11 -0400 | [diff] [blame] | 118 | headers, path_params, query_params, body) |
Joe Gregorio | fe695fb | 2010-08-30 12:04:04 -0400 | [diff] [blame] | 119 | |
| 120 | self.assertEqual(headers['accept'], 'application/json') |
| 121 | self.assertEqual(headers['content-type'], 'application/json') |
| 122 | |
Joe Gregorio | 61d7e96 | 2011-02-22 22:52:07 -0500 | [diff] [blame] | 123 | query_dict = parse_qs(query[1:]) |
Joe Gregorio | fe695fb | 2010-08-30 12:04:04 -0400 | [diff] [blame] | 124 | self.assertEqual(query_dict['foo'], ['1']) |
Pat Ferate | ca397a7 | 2015-03-03 18:06:15 -0800 | [diff] [blame] | 125 | if six.PY3: |
| 126 | # Python 3, no need to encode |
| 127 | self.assertEqual(query_dict['bar'], [u'\N{COMET}']) |
| 128 | else: |
| 129 | # Python 2, encode string |
| 130 | self.assertEqual(query_dict['bar'], [u'\N{COMET}'.encode('utf-8')]) |
Joe Gregorio | 61d7e96 | 2011-02-22 22:52:07 -0500 | [diff] [blame] | 131 | self.assertEqual(query_dict['baz'], ['fe', 'fi', 'fo', 'fum']) |
| 132 | self.assertTrue('qux' not in query_dict) |
Joe Gregorio | 913e70d | 2010-11-05 15:38:23 -0400 | [diff] [blame] | 133 | self.assertEqual(body, '{}') |
Joe Gregorio | fe695fb | 2010-08-30 12:04:04 -0400 | [diff] [blame] | 134 | |
Joe Gregorio | c5c5a37 | 2010-09-22 11:42:32 -0400 | [diff] [blame] | 135 | def test_user_agent(self): |
Joe Gregorio | d433b2a | 2011-02-22 10:51:51 -0500 | [diff] [blame] | 136 | model = JsonModel(data_wrapper=False) |
Joe Gregorio | c5c5a37 | 2010-09-22 11:42:32 -0400 | [diff] [blame] | 137 | |
| 138 | headers = {'user-agent': 'my-test-app/1.23.4'} |
| 139 | path_params = {} |
| 140 | query_params = {} |
| 141 | body = {} |
| 142 | |
Joe Gregorio | 5a4c328 | 2013-07-29 13:48:06 -0400 | [diff] [blame] | 143 | headers, unused_params, unused_query, body = model.request( |
Joe Gregorio | a314b1f | 2013-04-05 16:25:11 -0400 | [diff] [blame] | 144 | headers, path_params, query_params, body) |
Joe Gregorio | c5c5a37 | 2010-09-22 11:42:32 -0400 | [diff] [blame] | 145 | |
Joe Gregorio | a314b1f | 2013-04-05 16:25:11 -0400 | [diff] [blame] | 146 | self.assertEqual(headers['user-agent'], |
Bu Sun Kim | 07f647c | 2019-08-09 14:55:24 -0700 | [diff] [blame] | 147 | 'my-test-app/1.23.4 (gzip)') |
| 148 | |
| 149 | def test_x_goog_api_client(self): |
| 150 | model = JsonModel(data_wrapper=False) |
| 151 | |
| 152 | # test header composition for cloud clients that wrap discovery |
| 153 | headers = {'x-goog-api-client': 'gccl/1.23.4'} |
| 154 | path_params = {} |
| 155 | query_params = {} |
| 156 | body = {} |
| 157 | |
| 158 | headers, unused_params, unused_query, body = model.request( |
| 159 | headers, path_params, query_params, body) |
| 160 | |
| 161 | self.assertEqual(headers['x-goog-api-client'], |
| 162 | 'gccl/1.23.4' + ' gdcl/' + __version__ + ' gl-python/' + platform.python_version()) |
Joe Gregorio | c5c5a37 | 2010-09-22 11:42:32 -0400 | [diff] [blame] | 163 | |
| 164 | def test_bad_response(self): |
Joe Gregorio | d433b2a | 2011-02-22 10:51:51 -0500 | [diff] [blame] | 165 | model = JsonModel(data_wrapper=False) |
Joe Gregorio | c5c5a37 | 2010-09-22 11:42:32 -0400 | [diff] [blame] | 166 | resp = httplib2.Response({'status': '401'}) |
| 167 | resp.reason = 'Unauthorized' |
INADA Naoki | 0915761 | 2015-03-25 01:51:03 +0900 | [diff] [blame] | 168 | content = b'{"error": {"message": "not authorized"}}' |
Joe Gregorio | c5c5a37 | 2010-09-22 11:42:32 -0400 | [diff] [blame] | 169 | |
| 170 | try: |
| 171 | content = model.response(resp, content) |
| 172 | self.fail('Should have thrown an exception') |
INADA Naoki | c1505df | 2014-08-20 15:19:53 +0900 | [diff] [blame] | 173 | except HttpError as e: |
Joe Gregorio | 20b54fb | 2012-07-26 09:59:35 -0400 | [diff] [blame] | 174 | self.assertTrue('not authorized' in str(e)) |
Joe Gregorio | c5c5a37 | 2010-09-22 11:42:32 -0400 | [diff] [blame] | 175 | |
| 176 | resp['content-type'] = 'application/json' |
| 177 | |
| 178 | try: |
| 179 | content = model.response(resp, content) |
| 180 | self.fail('Should have thrown an exception') |
INADA Naoki | c1505df | 2014-08-20 15:19:53 +0900 | [diff] [blame] | 181 | except HttpError as e: |
Joe Gregorio | c5c5a37 | 2010-09-22 11:42:32 -0400 | [diff] [blame] | 182 | self.assertTrue('not authorized' in str(e)) |
| 183 | |
Joe Gregorio | c5c5a37 | 2010-09-22 11:42:32 -0400 | [diff] [blame] | 184 | def test_good_response(self): |
Joe Gregorio | d433b2a | 2011-02-22 10:51:51 -0500 | [diff] [blame] | 185 | model = JsonModel(data_wrapper=True) |
Joe Gregorio | c5c5a37 | 2010-09-22 11:42:32 -0400 | [diff] [blame] | 186 | resp = httplib2.Response({'status': '200'}) |
| 187 | resp.reason = 'OK' |
| 188 | content = '{"data": "is good"}' |
| 189 | |
| 190 | content = model.response(resp, content) |
| 191 | self.assertEqual(content, 'is good') |
Joe Gregorio | fe695fb | 2010-08-30 12:04:04 -0400 | [diff] [blame] | 192 | |
Joe Gregorio | 78a508d | 2010-10-26 16:36:36 -0400 | [diff] [blame] | 193 | def test_good_response_wo_data(self): |
Joe Gregorio | d433b2a | 2011-02-22 10:51:51 -0500 | [diff] [blame] | 194 | model = JsonModel(data_wrapper=False) |
Joe Gregorio | 78a508d | 2010-10-26 16:36:36 -0400 | [diff] [blame] | 195 | resp = httplib2.Response({'status': '200'}) |
| 196 | resp.reason = 'OK' |
| 197 | content = '{"foo": "is good"}' |
| 198 | |
| 199 | content = model.response(resp, content) |
| 200 | self.assertEqual(content, {'foo': 'is good'}) |
| 201 | |
| 202 | def test_good_response_wo_data_str(self): |
Joe Gregorio | d433b2a | 2011-02-22 10:51:51 -0500 | [diff] [blame] | 203 | model = JsonModel(data_wrapper=False) |
Joe Gregorio | 78a508d | 2010-10-26 16:36:36 -0400 | [diff] [blame] | 204 | resp = httplib2.Response({'status': '200'}) |
| 205 | resp.reason = 'OK' |
| 206 | content = '"data goes here"' |
| 207 | |
| 208 | content = model.response(resp, content) |
| 209 | self.assertEqual(content, 'data goes here') |
| 210 | |
Matt McDonald | 2a5f413 | 2011-04-29 16:32:27 -0400 | [diff] [blame] | 211 | def test_no_content_response(self): |
| 212 | model = JsonModel(data_wrapper=False) |
| 213 | resp = httplib2.Response({'status': '204'}) |
| 214 | resp.reason = 'No Content' |
| 215 | content = '' |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 216 | |
Matt McDonald | 2a5f413 | 2011-04-29 16:32:27 -0400 | [diff] [blame] | 217 | content = model.response(resp, content) |
| 218 | self.assertEqual(content, {}) |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 219 | |
Matt McDonald | 2a5f413 | 2011-04-29 16:32:27 -0400 | [diff] [blame] | 220 | def test_logging(self): |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 221 | class MockLogging(object): |
| 222 | def __init__(self): |
| 223 | self.info_record = [] |
| 224 | self.debug_record = [] |
| 225 | def info(self, message, *args): |
| 226 | self.info_record.append(message % args) |
| 227 | |
| 228 | def debug(self, message, *args): |
| 229 | self.debug_record.append(message % args) |
| 230 | |
| 231 | class MockResponse(dict): |
| 232 | def __init__(self, items): |
| 233 | super(MockResponse, self).__init__() |
| 234 | self.status = items['status'] |
INADA Naoki | d898a37 | 2015-03-04 03:52:46 +0900 | [diff] [blame] | 235 | for key, value in six.iteritems(items): |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 236 | self[key] = value |
Emmett Butler | 0969915 | 2016-02-08 14:26:00 -0800 | [diff] [blame] | 237 | old_logging = googleapiclient.model.LOGGER |
| 238 | googleapiclient.model.LOGGER = MockLogging() |
John Asmuth | 864311d | 2014-04-24 15:46:08 -0400 | [diff] [blame] | 239 | googleapiclient.model.dump_request_response = True |
Matt McDonald | 2a5f413 | 2011-04-29 16:32:27 -0400 | [diff] [blame] | 240 | model = JsonModel() |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 241 | request_body = { |
| 242 | 'field1': 'value1', |
| 243 | 'field2': 'value2' |
| 244 | } |
| 245 | body_string = model.request({}, {}, {}, request_body)[-1] |
Craig Citro | 6ae34d7 | 2014-08-18 23:10:09 -0700 | [diff] [blame] | 246 | json_body = json.loads(body_string) |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 247 | self.assertEqual(request_body, json_body) |
| 248 | |
| 249 | response = {'status': 200, |
| 250 | 'response_field_1': 'response_value_1', |
| 251 | 'response_field_2': 'response_value_2'} |
| 252 | response_body = model.response(MockResponse(response), body_string) |
| 253 | self.assertEqual(request_body, response_body) |
Emmett Butler | 0969915 | 2016-02-08 14:26:00 -0800 | [diff] [blame] | 254 | self.assertEqual(googleapiclient.model.LOGGER.info_record[:2], |
Joe Gregorio | afdf50b | 2011-03-08 09:41:52 -0500 | [diff] [blame] | 255 | ['--request-start--', |
| 256 | '-headers-start-']) |
| 257 | self.assertTrue('response_field_1: response_value_1' in |
Emmett Butler | 0969915 | 2016-02-08 14:26:00 -0800 | [diff] [blame] | 258 | googleapiclient.model.LOGGER.info_record) |
Joe Gregorio | afdf50b | 2011-03-08 09:41:52 -0500 | [diff] [blame] | 259 | self.assertTrue('response_field_2: response_value_2' in |
Emmett Butler | 0969915 | 2016-02-08 14:26:00 -0800 | [diff] [blame] | 260 | googleapiclient.model.LOGGER.info_record) |
| 261 | self.assertEqual(json.loads(googleapiclient.model.LOGGER.info_record[-2]), |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 262 | request_body) |
Emmett Butler | 0969915 | 2016-02-08 14:26:00 -0800 | [diff] [blame] | 263 | self.assertEqual(googleapiclient.model.LOGGER.info_record[-1], |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 264 | '--response-end--') |
Emmett Butler | 0969915 | 2016-02-08 14:26:00 -0800 | [diff] [blame] | 265 | googleapiclient.model.LOGGER = old_logging |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 266 | |
Ali Afshar | 81fde8e | 2012-10-23 11:14:28 -0700 | [diff] [blame] | 267 | def test_no_data_wrapper_deserialize(self): |
| 268 | model = JsonModel(data_wrapper=False) |
| 269 | resp = httplib2.Response({'status': '200'}) |
| 270 | resp.reason = 'OK' |
| 271 | content = '{"data": "is good"}' |
| 272 | content = model.response(resp, content) |
| 273 | self.assertEqual(content, {'data': 'is good'}) |
| 274 | |
| 275 | def test_data_wrapper_deserialize(self): |
| 276 | model = JsonModel(data_wrapper=True) |
| 277 | resp = httplib2.Response({'status': '200'}) |
| 278 | resp.reason = 'OK' |
| 279 | content = '{"data": "is good"}' |
| 280 | content = model.response(resp, content) |
| 281 | self.assertEqual(content, 'is good') |
| 282 | |
| 283 | def test_data_wrapper_deserialize_nodata(self): |
| 284 | model = JsonModel(data_wrapper=True) |
| 285 | resp = httplib2.Response({'status': '200'}) |
| 286 | resp.reason = 'OK' |
| 287 | content = '{"atad": "is good"}' |
| 288 | content = model.response(resp, content) |
| 289 | self.assertEqual(content, {'atad': 'is good'}) |
| 290 | |
| 291 | |
Joe Gregorio | 34044bc | 2011-03-07 16:58:33 -0500 | [diff] [blame] | 292 | |
Joe Gregorio | ba9ea7f | 2010-08-19 15:49:04 -0400 | [diff] [blame] | 293 | if __name__ == '__main__': |
| 294 | unittest.main() |