| Index: grit/format/policy_templates/writers/admx_writer_unittest.py
|
| diff --git a/grit/format/policy_templates/writers/admx_writer_unittest.py b/grit/format/policy_templates/writers/admx_writer_unittest.py
|
| index a573f2620768b3ae3aecf13156f916fb75e0b044..cb3d39e9b16a5ee9b9c48427912437e42ed1b7fd 100644
|
| --- a/grit/format/policy_templates/writers/admx_writer_unittest.py
|
| +++ b/grit/format/policy_templates/writers/admx_writer_unittest.py
|
| @@ -219,6 +219,46 @@ class AdmxWriterUnittest(xml_writer_base_unittest.XmlWriterBaseTest):
|
|
|
| self.AssertXMLEquals(output, expected_output)
|
|
|
| + def testRecommendedOnlyPolicy(self):
|
| + main_policy = {
|
| + 'name': 'DummyMainPolicy',
|
| + 'type': 'main',
|
| + 'features': {
|
| + 'can_be_recommended': True,
|
| + 'can_be_mandatory': False,
|
| + }
|
| + }
|
| +
|
| + policy_group = {
|
| + 'name': 'PolicyGroup',
|
| + 'policies': [main_policy],
|
| + }
|
| + self.writer.BeginTemplate()
|
| + self.writer.BeginRecommendedPolicyGroup(policy_group)
|
| +
|
| + self.writer.WritePolicy(main_policy)
|
| + self.writer.WriteRecommendedPolicy(main_policy)
|
| +
|
| + output = self.GetXMLOfChildren(self._GetPoliciesElement(self.writer._doc))
|
| + expected_output = (
|
| + '<policy class="TestClass" displayName="$(string.DummyMainPolicy)"'
|
| + ' explainText="$(string.DummyMainPolicy_Explain)"'
|
| + ' key="Software\\Policies\\Test\\Recommended"'
|
| + ' name="DummyMainPolicy_recommended"'
|
| + ' presentation="$(presentation.DummyMainPolicy)"'
|
| + ' valueName="DummyMainPolicy">\n'
|
| + ' <parentCategory ref="PolicyGroup_recommended"/>\n'
|
| + ' <supportedOn ref="SUPPORTED_TESTOS"/>\n'
|
| + ' <enabledValue>\n'
|
| + ' <decimal value="1"/>\n'
|
| + ' </enabledValue>\n'
|
| + ' <disabledValue>\n'
|
| + ' <decimal value="0"/>\n'
|
| + ' </disabledValue>\n'
|
| + '</policy>')
|
| +
|
| + self.AssertXMLEquals(output, expected_output)
|
| +
|
| def testStringPolicy(self):
|
| string_policy = {
|
| 'name': 'SampleStringPolicy',
|
|
|