Chromium Code Reviews| Index: grit/format/policy_templates/writers/plist_strings_writer_unittest.py |
| diff --git a/grit/format/policy_templates/writers/plist_strings_writer_unittest.py b/grit/format/policy_templates/writers/plist_strings_writer_unittest.py |
| index 613a3cd65b5b2197937d3efef86ac936ce22b6cd..c96f673bfe6a525e4edf823873cd16fb7a8ce346 100644 |
| --- a/grit/format/policy_templates/writers/plist_strings_writer_unittest.py |
| +++ b/grit/format/policy_templates/writers/plist_strings_writer_unittest.py |
| @@ -127,6 +127,112 @@ With a newline.""", |
| '"Description of policy.\\nWith a newline.";') |
| self.assertEquals(output.strip(), expected_output.strip()) |
| + |
|
Joao da Silva
2014/06/25 16:46:56
single newline
Andrew T Wilson (Slow)
2014/06/26 08:08:56
Done.
|
| + def testStringListPolicy(self): |
| + # Tests a policy group with a single policy of type 'list'. |
| + grd = self.PrepareTest(''' |
| + { |
| + 'policy_definitions': [ |
| + { |
| + 'name': 'ListGroup', |
| + 'type': 'group', |
| + 'caption': '', |
| + 'desc': '', |
| + 'policies': [{ |
| + 'name': 'ListPolicy', |
| + 'type': 'list', |
| + 'caption': 'Caption of policy.', |
| + 'desc': """Description of policy. |
| +With a newline.""", |
| + 'schema': { |
| + 'type': 'array', |
| + 'items': { 'type': 'string' }, |
| + }, |
| + 'supported_on': ['chrome.mac:8-'], |
| + }], |
| + }, |
| + ], |
| + 'placeholders': [], |
| + 'messages': { |
| + 'mac_chrome_preferences': { |
| + 'text': 'Preferences of $1', |
| + 'desc': 'blah' |
| + } |
| + } |
| + }''') |
| + output = self.GetOutput( |
| + grd, |
| + 'fr', |
| + {'_chromium' : '1', 'mac_bundle_id': 'com.example.Test'}, |
| + 'plist_strings', |
| + 'en') |
| + expected_output = ( |
| + 'Chromium.pfm_title = "Chromium";\n' |
| + 'Chromium.pfm_description = "Preferences of Chromium";\n' |
| + 'ListPolicy.pfm_title = "Caption of policy.";\n' |
| + 'ListPolicy.pfm_description = ' |
| + '"Description of policy.\\nWith a newline.";') |
| + self.assertEquals(output.strip(), expected_output.strip()) |
| + |
| + def testStringEnumListPolicy(self): |
| + # Tests a policy group with a single policy of type 'list'. |
|
Joao da Silva
2014/06/25 16:46:56
string-enum-list
Andrew T Wilson (Slow)
2014/06/26 08:08:56
Done.
|
| + grd = self.PrepareTest(''' |
| + { |
| + 'policy_definitions': [ |
| + { |
| + 'name': 'EnumGroup', |
| + 'type': 'group', |
| + 'caption': '', |
| + 'desc': '', |
| + 'policies': [{ |
| + 'name': 'EnumPolicy', |
| + 'type': 'string-enum-list', |
| + 'caption': 'Caption of policy.', |
| + 'desc': """Description of policy. |
| +With a newline.""", |
| + 'schema': { |
| + 'type': 'array', |
| + 'items': { 'type': 'string' }, |
| + }, |
| + 'items': [ |
| + { |
| + 'name': 'ProxyServerDisabled', |
| + 'value': 'one', |
| + 'caption': 'Option1' |
| + }, |
| + { |
| + 'name': 'ProxyServerAutoDetect', |
| + 'value': 'two', |
| + 'caption': 'Option2' |
| + }, |
| + ], |
| + 'supported_on': ['chrome.mac:8-'], |
| + }], |
| + }, |
| + ], |
| + 'placeholders': [], |
| + 'messages': { |
| + 'mac_chrome_preferences': { |
| + 'text': 'Preferences of $1', |
| + 'desc': 'blah' |
| + } |
| + } |
| + }''') |
| + output = self.GetOutput( |
| + grd, |
| + 'fr', |
| + {'_chromium' : '1', 'mac_bundle_id': 'com.example.Test'}, |
| + 'plist_strings', |
| + 'en') |
| + expected_output = ( |
| + 'Chromium.pfm_title = "Chromium";\n' |
| + 'Chromium.pfm_description = "Preferences of Chromium";\n' |
| + 'EnumPolicy.pfm_title = "Caption of policy.";\n' |
| + 'EnumPolicy.pfm_description = ' |
| + '"one - Option1\\ntwo - Option2\\n' |
| + 'Description of policy.\\nWith a newline.";') |
| + self.assertEquals(output.strip(), expected_output.strip()) |
| + |
| def testIntEnumPolicy(self): |
| # Tests a policy group with a single policy of type 'int-enum'. |
| grd = self.PrepareTest(''' |