| Index: grit/format/policy_templates/policy_template_generator_unittest.py
|
| diff --git a/grit/format/policy_templates/policy_template_generator_unittest.py b/grit/format/policy_templates/policy_template_generator_unittest.py
|
| index f06cc2d21899d84ade452a1374beda1d006ef877..adc4a224f350d3ac410c60114acf2a4e0d53aeb0 100644
|
| --- a/grit/format/policy_templates/policy_template_generator_unittest.py
|
| +++ b/grit/format/policy_templates/policy_template_generator_unittest.py
|
| @@ -262,6 +262,29 @@ class PolicyTemplateGeneratorUnittest(unittest.TestCase):
|
| self.tester.assertEquals(policy['items'][2]['caption'], 'string3')
|
| self.do_test(policy_data_mock, LocalMockWriter())
|
|
|
| + def testStringEnumTexts(self):
|
| + # Test that GUI messages are assigned correctly to string-enums
|
| + # (aka dropdown menus).
|
| + policy_data_mock = {
|
| + 'policy_definitions': [{
|
| + 'name': 'Policy1',
|
| + 'type': 'string-enum-list',
|
| + 'caption': '', 'desc': '',
|
| + 'supported_on': [],
|
| + 'items': [
|
| + {'name': 'item1', 'value': 'one', 'caption': 'string1', 'desc': ''},
|
| + {'name': 'item2', 'value': 'two', 'caption': 'string2', 'desc': ''},
|
| + {'name': 'item3', 'value': 'three', 'caption': 'string3', 'desc': ''},
|
| + ]
|
| + }]
|
| + }
|
| + class LocalMockWriter(mock_writer.MockWriter):
|
| + def WritePolicy(self, policy):
|
| + self.tester.assertEquals(policy['items'][0]['caption'], 'string1')
|
| + self.tester.assertEquals(policy['items'][1]['caption'], 'string2')
|
| + self.tester.assertEquals(policy['items'][2]['caption'], 'string3')
|
| + self.do_test(policy_data_mock, LocalMockWriter())
|
| +
|
| def testPolicyFiltering(self):
|
| # Test that policies are filtered correctly based on their annotations.
|
| policy_data_mock = {
|
|
|