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

Unified Diff: grit/format/policy_templates/writers/doc_writer_unittest.py

Issue 347293003: Added support for string-enum-list. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 6 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: grit/format/policy_templates/writers/doc_writer_unittest.py
===================================================================
--- grit/format/policy_templates/writers/doc_writer_unittest.py (revision 169)
+++ grit/format/policy_templates/writers/doc_writer_unittest.py (working copy)
@@ -282,7 +282,7 @@
'<root>0x00000010 (Windows), 16 (Linux), 16 (Mac)</root>')
def testStringEnumExample(self):
- # Test representation of 'int-enum' example values.
+ # Test representation of 'string-enum' example values.
policy = {
'name': 'PolicyName',
'type': 'string-enum',
@@ -293,6 +293,40 @@
self.doc_root.toxml(),
'<root>&quot;wacky&quot;</root>')
+ def testListExample(self):
+ # Test representation of 'list' example values.
+ policy = {
+ 'name': 'PolicyName',
+ 'type': 'list',
+ 'example_value': ['one', 'two'],
+ 'supported_on': [ { 'platforms': ['linux'] } ]
+ }
+ self.writer._AddExample(self.doc_root, policy)
+ self.assertEquals(
+ self.doc_root.toxml(),
+ '<root><dl style="style_dd dl;">'
+ '<dt>Linux:</dt>'
+ '<dd style="style_.monospace;">'
+ '[&quot;one&quot;, &quot;two&quot;]'
+ '</dd></dl></root>')
+
+ def testStringEnumListExample(self):
+ # Test representation of 'string-enum-list' example values.
+ policy = {
+ 'name': 'PolicyName',
+ 'type': 'string-enum-list',
+ 'example_value': ['one', 'two'],
+ 'supported_on': [ { 'platforms': ['linux'] } ]
+ }
+ self.writer._AddExample(self.doc_root, policy)
+ self.assertEquals(
+ self.doc_root.toxml(),
+ '<root><dl style="style_dd dl;">'
+ '<dt>Linux:</dt>'
+ '<dd style="style_.monospace;">'
+ '[&quot;one&quot;, &quot;two&quot;]'
+ '</dd></dl></root>')
+
def testStringExample(self):
# Test representation of 'string' example values.
policy = {
« no previous file with comments | « grit/format/policy_templates/writers/doc_writer.py ('k') | grit/format/policy_templates/writers/ios_plist_writer_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698