Index: grit/format/policy_templates/writers/json_writer_unittest.py |
diff --git a/grit/format/policy_templates/writers/json_writer_unittest.py b/grit/format/policy_templates/writers/json_writer_unittest.py |
index 05ae25523bd5189a0db273024da46ae9cea3b132..b2ed1ef3b11c5396deff9455507d7aebae31e0b8 100644 |
--- a/grit/format/policy_templates/writers/json_writer_unittest.py |
+++ b/grit/format/policy_templates/writers/json_writer_unittest.py |
@@ -86,6 +86,40 @@ class JsonWriterUnittest(writer_unittest_common.WriterUnittestCommon): |
'}') |
self.CompareOutputs(output, expected_output) |
+ def testRecommendedOnlyPolicy(self): |
+ # Tests a policy group with a single policy of type 'main'. |
+ grd = self.PrepareTest( |
+ '{' |
+ ' "policy_definitions": [' |
+ ' {' |
+ ' "name": "MainPolicy",' |
+ ' "type": "main",' |
+ ' "caption": "Example Main Policy",' |
+ ' "desc": "Example Main Policy",' |
+ ' "features": {' |
+ ' "can_be_recommended": True,' |
+ ' "can_be_mandatory": False' |
+ ' },' |
+ ' "supported_on": ["chrome.linux:8-"],' |
+ ' "example_value": True' |
+ ' },' |
+ ' ],' |
+ ' "placeholders": [],' |
+ ' "messages": {},' |
+ '}') |
+ output = self.GetOutput(grd, 'fr', {'_google_chrome' : '1'}, 'json', 'en') |
+ expected_output = ( |
+ TEMPLATE_HEADER + |
+ ' // Note: this policy is supported only in recommended mode.\n' + |
+ ' // The JSON file should be placed in' + |
+ ' /etc/opt/chrome/policies/recommended.\n' + |
+ ' // Example Main Policy\n' + |
+ HEADER_DELIMETER + |
+ ' // Example Main Policy\n\n' |
+ ' //"MainPolicy": true\n\n' |
+ '}') |
+ self.CompareOutputs(output, expected_output) |
+ |
def testStringPolicy(self): |
# Tests a policy group with a single policy of type 'string'. |
grd = self.PrepareTest( |