OLD | NEW |
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 from copy import deepcopy | 6 from copy import deepcopy |
7 import json | 7 import json |
8 import unittest | 8 import unittest |
9 | 9 |
10 from compiled_file_system import CompiledFileSystem | 10 from compiled_file_system import CompiledFileSystem |
11 from features_bundle import FeaturesBundle | 11 from features_bundle import FeaturesBundle |
| 12 from future import Future |
12 import manifest_data_source | 13 import manifest_data_source |
13 from object_store_creator import ObjectStoreCreator | 14 from object_store_creator import ObjectStoreCreator |
14 | 15 |
15 | 16 |
16 convert_and_annotate_docs = { | 17 convert_and_annotate_docs = { |
17 'name': { | 18 'name': { |
18 'example': "My {{title}}", | 19 'example': "My {{title}}", |
19 'name': 'name', | 20 'name': 'name', |
20 'level': 'required' | 21 'level': 'required' |
21 }, | 22 }, |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 'platforms': ['apps'], | 240 'platforms': ['apps'], |
240 'is_last': True | 241 'is_last': True |
241 } | 242 } |
242 ], | 243 ], |
243 'is_last': True | 244 'is_last': True |
244 } | 245 } |
245 ] | 246 ] |
246 | 247 |
247 class FakeFeaturesBundle(object): | 248 class FakeFeaturesBundle(object): |
248 def GetManifestFeatures(self): | 249 def GetManifestFeatures(self): |
249 return manifest_features | 250 return Future(value=manifest_features) |
250 | 251 |
251 class FakeServerInstance(object): | 252 class FakeServerInstance(object): |
252 def __init__(self): | 253 def __init__(self): |
253 self.features_bundle = FakeFeaturesBundle() | 254 self.features_bundle = FakeFeaturesBundle() |
254 self.object_store_creator = ObjectStoreCreator.ForTest() | 255 self.object_store_creator = ObjectStoreCreator.ForTest() |
255 | 256 |
256 mds = manifest_data_source.ManifestDataSource(FakeServerInstance(), None) | 257 mds = manifest_data_source.ManifestDataSource(FakeServerInstance(), None) |
257 self.assertEqual(expected_app, mds.get('apps')) | 258 self.assertEqual(expected_app, mds.get('apps')) |
258 | 259 |
259 if __name__ == '__main__': | 260 if __name__ == '__main__': |
260 unittest.main() | 261 unittest.main() |
OLD | NEW |