aboutsummaryrefslogtreecommitdiff
path: root/grit/format/policy_templates/writers/doc_writer_unittest.py
diff options
context:
space:
mode:
Diffstat (limited to 'grit/format/policy_templates/writers/doc_writer_unittest.py')
-rw-r--r--grit/format/policy_templates/writers/doc_writer_unittest.py36
1 files changed, 35 insertions, 1 deletions
diff --git a/grit/format/policy_templates/writers/doc_writer_unittest.py b/grit/format/policy_templates/writers/doc_writer_unittest.py
index 6c087d5..05ea240 100644
--- a/grit/format/policy_templates/writers/doc_writer_unittest.py
+++ b/grit/format/policy_templates/writers/doc_writer_unittest.py
@@ -282,7 +282,7 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
'<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 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
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 = {