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 import os | 5 import os |
6 import sys | 6 import sys |
7 import unittest | 7 import unittest |
8 | 8 |
9 import api_schema_graph | 9 import api_schema_graph |
10 from availability_finder import AvailabilityFinder, AvailabilityInfo | 10 from availability_finder import AvailabilityFinder, AvailabilityInfo |
11 from branch_utility import BranchUtility, ChannelInfo | 11 from branch_utility import BranchUtility, ChannelInfo |
12 from compiled_file_system import CompiledFileSystem | 12 from compiled_file_system import CompiledFileSystem |
13 from fake_host_file_system_provider import FakeHostFileSystemProvider | 13 from fake_host_file_system_provider import FakeHostFileSystemProvider |
14 from fake_url_fetcher import FakeUrlFetcher | 14 from fake_url_fetcher import FakeUrlFetcher |
15 from host_file_system_iterator import HostFileSystemIterator | 15 from host_file_system_iterator import HostFileSystemIterator |
16 from mock_function import MockFunction | 16 from mock_function import MockFunction |
17 from object_store_creator import ObjectStoreCreator | 17 from object_store_creator import ObjectStoreCreator |
18 from platform_util import GetPlatforms | 18 from platform_util import GetPlatforms |
19 from test_data.canned_data import (CANNED_API_FILE_SYSTEM_DATA, CANNED_BRANCHES) | 19 from test_data.canned_data import (CANNED_API_FILE_SYSTEM_DATA, CANNED_BRANCHES) |
20 from test_data.object_level_availability.tabs import TABS_SCHEMA_BRANCHES | 20 from test_data.object_level_availability.tabs import TABS_SCHEMA_BRANCHES |
21 from test_util import Server2Path | 21 from test_util import Server2Path |
| 22 from process_schema import ProcessSchemaFactoryForTest |
22 | 23 |
23 | 24 |
24 TABS_UNMODIFIED_VERSIONS = (16, 20, 23, 24) | 25 TABS_UNMODIFIED_VERSIONS = (16, 20, 23, 24) |
25 | 26 |
26 class AvailabilityFinderTest(unittest.TestCase): | 27 class AvailabilityFinderTest(unittest.TestCase): |
27 | 28 |
28 def _create_availability_finder(self, | 29 def _create_availability_finder(self, |
29 host_fs_creator, | 30 host_fs_creator, |
30 host_fs_iterator, | 31 host_fs_iterator, |
31 platform): | 32 platform): |
32 test_object_store = ObjectStoreCreator.ForTest() | 33 test_object_store = ObjectStoreCreator.ForTest() |
33 return AvailabilityFinder( | 34 return AvailabilityFinder( |
34 self._branch_utility, | 35 self._branch_utility, |
35 CompiledFileSystem.Factory(test_object_store), | 36 CompiledFileSystem.Factory(test_object_store), |
36 host_fs_iterator, | 37 host_fs_iterator, |
37 host_fs_creator.GetTrunk(), | 38 host_fs_creator.GetTrunk(), |
38 test_object_store, | 39 test_object_store, |
39 platform) | 40 platform, |
| 41 ProcessSchemaFactoryForTest()) |
40 | 42 |
41 def setUp(self): | 43 def setUp(self): |
42 self._branch_utility = BranchUtility( | 44 self._branch_utility = BranchUtility( |
43 os.path.join('branch_utility', 'first.json'), | 45 os.path.join('branch_utility', 'first.json'), |
44 os.path.join('branch_utility', 'second.json'), | 46 os.path.join('branch_utility', 'second.json'), |
45 FakeUrlFetcher(Server2Path('test_data')), | 47 FakeUrlFetcher(Server2Path('test_data')), |
46 ObjectStoreCreator.ForTest()) | 48 ObjectStoreCreator.ForTest()) |
47 self._api_fs_creator = FakeHostFileSystemProvider( | 49 self._api_fs_creator = FakeHostFileSystemProvider( |
48 CANNED_API_FILE_SYSTEM_DATA) | 50 CANNED_API_FILE_SYSTEM_DATA) |
49 self._node_fs_creator = FakeHostFileSystemProvider(TABS_SCHEMA_BRANCHES) | 51 self._node_fs_creator = FakeHostFileSystemProvider(TABS_SCHEMA_BRANCHES) |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 'UpdateInfo')) | 288 'UpdateInfo')) |
287 assertEquals(False, None, tabs_graph.Lookup('tabs', 'functions', 'get', | 289 assertEquals(False, None, tabs_graph.Lookup('tabs', 'functions', 'get', |
288 'parameters', 'callback', 'parameters', 'tab', 'id')) | 290 'parameters', 'callback', 'parameters', 'tab', 'id')) |
289 assertEquals(False, None, tabs_graph.Lookup('functions')) | 291 assertEquals(False, None, tabs_graph.Lookup('functions')) |
290 assertEquals(False, None, tabs_graph.Lookup('events', 'onActivated', | 292 assertEquals(False, None, tabs_graph.Lookup('events', 'onActivated', |
291 'parameters', 'activeInfo', 'tabId')) | 293 'parameters', 'activeInfo', 'tabId')) |
292 | 294 |
293 | 295 |
294 if __name__ == '__main__': | 296 if __name__ == '__main__': |
295 unittest.main() | 297 unittest.main() |
OLD | NEW |