Index: tools/json_schema_compiler/model_test.py |
diff --git a/tools/json_schema_compiler/model_test.py b/tools/json_schema_compiler/model_test.py |
index 61a65e72015887081c745e5575ccc3973f88b2eb..ea4af1c63c9a5d7a12e4f2c672c6ce251a826024 100644 |
--- a/tools/json_schema_compiler/model_test.py |
+++ b/tools/json_schema_compiler/model_test.py |
@@ -26,9 +26,9 @@ class ModelTest(unittest.TestCase): |
self.assertEquals(3, len(self.model.namespaces)) |
self.assertTrue(self.permissions) |
- def testNamespaceNocompile(self): |
+ def testNamespaceNoCompile(self): |
self.permissions_json[0]['namespace'] = 'something' |
- del self.permissions_json[0]['compile'] |
+ self.permissions_json[0]['nocompile'] = True |
self.model.AddNamespace(self.permissions_json[0], |
'path/to/something.json') |
self.assertEquals(3, len(self.model.namespaces)) |
@@ -42,7 +42,7 @@ class ModelTest(unittest.TestCase): |
self.assertRaises(AssertionError, self.model.AddNamespace, |
self.permissions_json[0], 'path/to/something.json') |
- def testFunctionNocompile(self): |
+ def testFunctionNoCompile(self): |
# tabs.json has 2 functions marked as nocompile (connect, sendRequest) |
self.assertEquals(["captureVisibleTab", "create", "detectLanguage", |
"executeScript", "get", "getAllInWindow", "getCurrent", |
@@ -77,7 +77,11 @@ class ModelTest(unittest.TestCase): |
["active", "highlighted", "pinned", "status", "title", "url", |
"windowId", "windowType"], |
sorted(object_prop.properties.keys())) |
- # TODO(calamity): test choices |
+ |
+ def testChoices(self): |
+ self.assertTrue(self.permissions.functions['move'].params[0].is_choice) |
+ self.assertTrue(self.permissions.functions['move'].params[1].is_choice) |
+ self.assertFalse(self.permissions.functions['get'].params[0].is_choice) |
def testPropertyNotImplemented(self): |
(self.permissions_json[0]['types'][0] |
@@ -89,7 +93,7 @@ class ModelTest(unittest.TestCase): |
self.assertFalse( |
self.permissions.functions['contains'].params[0].description) |
self.assertEquals('True if the extension has the specified permissions.', |
- self.permissions.functions['contains'].callback.param.description) |
+ self.permissions.functions['contains'].callback.params[0].description) |
if __name__ == '__main__': |
unittest.main() |