Chromium Code Reviews| Index: grit/format/policy_templates/writers/adm_writer_unittest.py |
| =================================================================== |
| --- grit/format/policy_templates/writers/adm_writer_unittest.py (revision 177) |
| +++ grit/format/policy_templates/writers/adm_writer_unittest.py (working copy) |
| @@ -76,6 +76,41 @@ |
| chromium_recommended="Chromium - Recommended"''') |
| self.CompareOutputs(output, expected_output) |
| + def testEmptyVersion(self): |
| + # Test PListWriter in case of empty polices. |
| + grd = self.PrepareTest(''' |
| + { |
| + 'policy_definitions': [], |
| + 'placeholders': [], |
| + 'messages': { |
| + 'win_supported_winxpsp2': { |
| + 'text': 'At least "Windows 3.11', 'desc': 'blah' |
| + }, |
| + 'doc_recommended': { |
| + 'text': 'Recommended', 'desc': 'bleh' |
| + } |
| + } |
| + }''') |
| + output = self.GetOutput(grd, 'fr', {'_chromium': '1', 'version':'39.0.0.0'}, 'adm', 'en') |
|
pastarmovj
2014/10/07 14:54:35
nit: Line too long.
cschuet1
2014/10/07 15:42:45
Done.
|
| + expected_output = '''; chromium version: 39.0.0.0\n''' + self.ConstructOutput( |
|
pastarmovj
2014/10/07 14:54:35
Ditto.
cschuet1
2014/10/07 15:42:45
Done.
|
| + ['MACHINE', 'USER'], ''' |
| + CATEGORY !!chromium |
| + KEYNAME "Software\\Policies\\Chromium" |
| + |
| + END CATEGORY |
| + |
| + CATEGORY !!chromium_recommended |
| + KEYNAME "Software\\Policies\\Chromium\\Recommended" |
| + |
| + END CATEGORY |
| + |
| + |
| +''', '''[Strings] |
| +SUPPORTED_WINXPSP2="At least "Windows 3.11" |
| +chromium="Chromium" |
| +chromium_recommended="Chromium - Recommended"''') |
| + self.CompareOutputs(output, expected_output) |
| + |
| def testMainPolicy(self): |
| # Tests a policy group with a single policy of type 'main'. |
| grd = self.PrepareTest(''' |