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

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

Issue 14218004: Devserver: only populate data during cron jobs, meaning all data from instances (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix integration test Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 json 6 import json
7 import os 7 import os
8 import sys 8 import sys
9 import unittest 9 import unittest
10 10
11 from file_system import FileNotFoundError 11 from file_system import FileNotFoundError
12 from in_memory_object_store import InMemoryObjectStore
13 from reference_resolver import ReferenceResolver 12 from reference_resolver import ReferenceResolver
14 from test_object_store import TestObjectStore 13 from test_object_store import TestObjectStore
15 14
16 class FakeAPIDataSource(object): 15 class FakeAPIDataSource(object):
17 def __init__(self, json_data): 16 def __init__(self, json_data):
18 self._json = json_data 17 self._json = json_data
19 18
20 def get(self, key): 19 def get(self, key):
21 if key not in self._json: 20 if key not in self._json:
22 raise FileNotFoundError(key) 21 raise FileNotFoundError(key)
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 namespace='baz')) 158 namespace='baz'))
160 159
161 # Allow bare "$ref:foo.bar." at the end of a string. 160 # Allow bare "$ref:foo.bar." at the end of a string.
162 self.assertEqual( 161 self.assertEqual(
163 '<a href="bar.html#type-bon">bar.bon</a>.', 162 '<a href="bar.html#type-bon">bar.bon</a>.',
164 resolver.ResolveAllLinks('$ref:bar.bon.', 163 resolver.ResolveAllLinks('$ref:bar.bon.',
165 namespace='baz')) 164 namespace='baz'))
166 165
167 if __name__ == '__main__': 166 if __name__ == '__main__':
168 unittest.main() 167 unittest.main()
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/preview.py ('k') | chrome/common/extensions/docs/server2/server_instance.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698