| Index: tools/grit/grit/gather/policy_json_unittest.py
|
| diff --git a/tools/grit/grit/gather/policy_json_unittest.py b/tools/grit/grit/gather/policy_json_unittest.py
|
| index f443e430a5403cdeb57069082456f35cc0ff2da5..9f141d6f18dc9fbaee4b101d04f0f92056884bd9 100644
|
| --- a/tools/grit/grit/gather/policy_json_unittest.py
|
| +++ b/tools/grit/grit/gather/policy_json_unittest.py
|
| @@ -65,8 +65,10 @@ class PolicyJsonUnittest(unittest.TestCase):
|
| "{"
|
| " 'policy_definitions': ["
|
| " {"
|
| + " 'name': 'Policy1',"
|
| " 'items': ["
|
| " {"
|
| + " 'name': 'Item1',"
|
| " 'caption': 'nothing special',"
|
| " }"
|
| " ]"
|
| @@ -88,6 +90,7 @@ class PolicyJsonUnittest(unittest.TestCase):
|
| " {"
|
| " 'policies': ["
|
| " {"
|
| + " 'name': 'Policy1',"
|
| " 'caption': 'nothing special',"
|
| " }"
|
| " ]"
|
| @@ -150,6 +153,7 @@ with a newline?''',
|
| original = """{
|
| 'policy_definitions': [
|
| {
|
| + 'name': 'Policy1',
|
| 'caption': '''Please install
|
| <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.''',
|
| },
|
| @@ -170,7 +174,22 @@ with a newline?''',
|
| self.failUnless(ph.GetPresentation() == 'PRODUCT_NAME')
|
| self.failUnless(ph.GetExample() == 'Google Chrome')
|
|
|
| + def testGetDescription(self):
|
| + gatherer = policy_json.PolicyJson({})
|
| + self.assertEquals(
|
| + gatherer._GetDescription({'name': 'Policy1'}, 'policy', None, 'desc'),
|
| + 'Description of the policy named Policy1')
|
| + self.assertEquals(
|
| + gatherer._GetDescription({'name': 'Plcy2'}, 'policy', None, 'caption'),
|
| + 'Caption of the policy named Plcy2')
|
| + self.assertEquals(
|
| + gatherer._GetDescription({'name': 'Plcy3'}, 'policy', None, 'label'),
|
| + 'Label of the policy named Plcy3')
|
| + self.assertEquals(
|
| + gatherer._GetDescription({'name': 'Item'}, 'enum_item',
|
| + {'name': 'Policy'}, 'caption'),
|
| + 'Caption of the option named Item in policy Policy')
|
| +
|
|
|
| if __name__ == '__main__':
|
| unittest.main()
|
| -
|
|
|