OLD | NEW |
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 unittest | 6 import unittest |
7 | 7 |
8 from api_data_source import APIDataSource | 8 from api_data_source import APIDataSource |
9 from extensions_paths import CHROME_EXTENSIONS | 9 from extensions_paths import CHROME_EXTENSIONS |
10 from servlet import Request | 10 from servlet import Request |
11 from server_instance import ServerInstance | 11 from server_instance import ServerInstance |
12 from test_data.api_data_source.canned_trunk_fs import CANNED_TRUNK_FS_DATA | 12 from test_data.api_data_source.canned_master_fs import CANNED_MASTER_FS_DATA |
13 from test_file_system import TestFileSystem | 13 from test_file_system import TestFileSystem |
14 | 14 |
15 | 15 |
16 class APIDataSourceTest(unittest.TestCase): | 16 class APIDataSourceTest(unittest.TestCase): |
17 def setUp(self): | 17 def setUp(self): |
18 self.server_instance = ServerInstance.ForTest( | 18 self.server_instance = ServerInstance.ForTest( |
19 TestFileSystem(CANNED_TRUNK_FS_DATA, relative_to=CHROME_EXTENSIONS)) | 19 TestFileSystem(CANNED_MASTER_FS_DATA, relative_to=CHROME_EXTENSIONS)) |
20 | 20 |
21 def testGet(self): | 21 def testGet(self): |
22 api_ds = APIDataSource(self.server_instance, Request.ForTest('/')) | 22 api_ds = APIDataSource(self.server_instance, Request.ForTest('/')) |
23 jsc_view = api_ds.get('extensions').get('tester') | 23 jsc_view = api_ds.get('extensions').get('tester') |
24 funcs_arr = [{ | 24 funcs_arr = [{ |
25 'availability': None, | 25 'availability': None, |
26 'callback': { | 26 'callback': { |
27 'name': 'callback', | 27 'name': 'callback', |
28 'optional': False, | 28 'optional': False, |
29 'parameters': [{ | 29 'parameters': [{ |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 'parentName': 'TypeA', | 192 'parentName': 'TypeA', |
193 'properties': [], | 193 'properties': [], |
194 'returns': None | 194 'returns': None |
195 }], | 195 }], |
196 'simple_type': 'object' | 196 'simple_type': 'object' |
197 }] | 197 }] |
198 self.assertEquals(types_arr, jsc_view['types']) | 198 self.assertEquals(types_arr, jsc_view['types']) |
199 | 199 |
200 if __name__ == '__main__': | 200 if __name__ == '__main__': |
201 unittest.main() | 201 unittest.main() |
OLD | NEW |