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

Unified Diff: tools/json_schema_compiler/cpp_type_generator_test.py

Issue 10701012: JSON Schema Compiler: Added event compilation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reworked Create functions and lots of tests. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: tools/json_schema_compiler/cpp_type_generator_test.py
diff --git a/tools/json_schema_compiler/cpp_type_generator_test.py b/tools/json_schema_compiler/cpp_type_generator_test.py
index b22c430274409daa7a20c93fa5c57af6553249b3..f8cf158e9e4797792c7a15662c43e7e3079bbe5b 100755
--- a/tools/json_schema_compiler/cpp_type_generator_test.py
+++ b/tools/json_schema_compiler/cpp_type_generator_test.py
@@ -210,15 +210,27 @@ class CppTypeGeneratorTest(unittest.TestCase):
'} // extensions',
manager.GetRootNamespaceEnd().Render())
- def testExpandChoicesInParams(self):
+ def testGetAllPossibleParameters(self):
manager = CppTypeGenerator('extensions', self.tabs,
self.tabs.unix_name)
props = self.tabs.functions['move'].params
self.assertEquals(2, len(props))
- self.assertEquals(3, len(manager.GetExpandedChoicesInParams(props)))
+ self.assertEquals(3, len(manager.GetAllPossibleParameters(props)))
self.assertEquals(['move_properties', 'tab_ids_array', 'tab_ids_integer'],
- sorted([x.unix_name for x in manager.GetExpandedChoicesInParams(props)])
+ sorted([x.unix_name for x in manager.GetAllPossibleParameters(props)])
)
+ def testGetAllPossibleParameterLists(self):
+ manager = CppTypeGenerator('extensions', self.tabs,
+ self.tabs.unix_name)
not at google - send to devlin 2012/07/11 07:22:06 nit: parameters should all be on 1 line or vertica
Matt Tytel 2012/07/12 03:07:56 Ah copied this from the function above. Done.
+ props = self.tabs.functions['move'].params
+ self.assertEquals(2, len(props))
+ self.assertEquals(2, len(manager.GetAllPossibleParameterLists(props)))
+ expected_lists = [['move_properties', 'tab_ids_array'],
not at google - send to devlin 2012/07/11 07:22:06 Not being used? Looks like this was half transiti
Matt Tytel 2012/07/12 03:07:56 Dang rushed through this test. Somehow deleted the
+ ['move_properties', 'tab_ids_integer']]
+ param_lists = manager.GetAllPossibleParameterLists(props)
not at google - send to devlin 2012/07/11 07:22:06 looks like this is being evaluated twice? move thi
Matt Tytel 2012/07/12 03:07:56 Done.
+ result_lists = sorted([sorted([param.unix_name for param in param_list])
+ for param_list in param_lists])
+
if __name__ == '__main__':
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698