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

Unified Diff: tools/grit/grit/gather/policy_json_unittest.py

Issue 6312006: Fix generating descriptions of policy template strings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/tools/grit/grit/gather
Patch Set: rebase Created 9 years, 11 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
« no previous file with comments | « tools/grit/grit/gather/policy_json.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/gather/policy_json_unittest.py
diff --git a/tools/grit/grit/gather/policy_json_unittest.py b/tools/grit/grit/gather/policy_json_unittest.py
index f443e430a5403cdeb57069082456f35cc0ff2da5..9f141d6f18dc9fbaee4b101d04f0f92056884bd9 100644
--- a/tools/grit/grit/gather/policy_json_unittest.py
+++ b/tools/grit/grit/gather/policy_json_unittest.py
@@ -65,8 +65,10 @@ class PolicyJsonUnittest(unittest.TestCase):
"{"
" 'policy_definitions': ["
" {"
+ " 'name': 'Policy1',"
" 'items': ["
" {"
+ " 'name': 'Item1',"
" 'caption': 'nothing special',"
" }"
" ]"
@@ -88,6 +90,7 @@ class PolicyJsonUnittest(unittest.TestCase):
" {"
" 'policies': ["
" {"
+ " 'name': 'Policy1',"
" 'caption': 'nothing special',"
" }"
" ]"
@@ -150,6 +153,7 @@ with a newline?''',
original = """{
'policy_definitions': [
{
+ 'name': 'Policy1',
'caption': '''Please install
<ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.''',
},
@@ -170,7 +174,22 @@ with a newline?''',
self.failUnless(ph.GetPresentation() == 'PRODUCT_NAME')
self.failUnless(ph.GetExample() == 'Google Chrome')
+ def testGetDescription(self):
+ gatherer = policy_json.PolicyJson({})
+ self.assertEquals(
+ gatherer._GetDescription({'name': 'Policy1'}, 'policy', None, 'desc'),
+ 'Description of the policy named Policy1')
+ self.assertEquals(
+ gatherer._GetDescription({'name': 'Plcy2'}, 'policy', None, 'caption'),
+ 'Caption of the policy named Plcy2')
+ self.assertEquals(
+ gatherer._GetDescription({'name': 'Plcy3'}, 'policy', None, 'label'),
+ 'Label of the policy named Plcy3')
+ self.assertEquals(
+ gatherer._GetDescription({'name': 'Item'}, 'enum_item',
+ {'name': 'Policy'}, 'caption'),
+ 'Caption of the option named Item in policy Policy')
+
if __name__ == '__main__':
unittest.main()
-
« no previous file with comments | « tools/grit/grit/gather/policy_json.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698