Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: chrome/common/extensions/docs/server2/schema_util_test.py

Issue 385703005: Docserver: Modify doc inlining so all relevant data is present in availability_finder.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final nit Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import unittest 6 import unittest
7 from copy import deepcopy 7 from copy import deepcopy
8 8
9 from schema_util import RemoveNoDocs, DetectInlineableTypes, InlineDocs 9 from schema_util import RemoveNoDocs, DetectInlineableTypes, InlineDocs
10 10
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 'type': 'string' 163 'type': 'string'
164 }, 164 },
165 'type': 'array', 165 'type': 'array',
166 'id': 'KeyList', 166 'id': 'KeyList',
167 'description': 'A list of keys' 167 'description': 'A list of keys'
168 } 168 }
169 ] 169 ]
170 } 170 }
171 171
172 inlined_schema = deepcopy(schema) 172 inlined_schema = deepcopy(schema)
173 InlineDocs(inlined_schema) 173 InlineDocs(inlined_schema, False)
174 self.assertEqual(expected_schema, inlined_schema) 174 self.assertEqual(expected_schema, inlined_schema)
175 175
176 def testDetectInline(self): 176 def testDetectInline(self):
177 schema = { 177 schema = {
178 'types': [ 178 'types': [
179 { 179 {
180 'id': 'Key', 180 'id': 'Key',
181 'items': { 181 'items': {
182 '$ref': 'Value' 182 '$ref': 'Value'
183 } 183 }
(...skipping 10 matching lines...) Expand all
194 { 194 {
195 'id': 'Key', 195 'id': 'Key',
196 'items': { 196 'items': {
197 'marker': True, 197 'marker': True,
198 } 198 }
199 } 199 }
200 ] 200 ]
201 } 201 }
202 202
203 DetectInlineableTypes(schema) 203 DetectInlineableTypes(schema)
204 InlineDocs(schema) 204 InlineDocs(schema, False)
205 self.assertEqual(expected_schema, schema) 205 self.assertEqual(expected_schema, schema)
206 206
207 207
208 if __name__ == '__main__': 208 if __name__ == '__main__':
209 unittest.main() 209 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698