Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py

Issue 6360002: Remove 'annotations' dictionary in policy_definitions.json. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better comments Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py
diff --git a/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py b/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py
index 56f02f31c85084724919e2b2aa881ccfcf776637..618650091fa25400ede2c9c23bb5a9f24035df15 100644
--- a/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py
+++ b/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py
@@ -196,9 +196,7 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
def testAddFeatures(self):
# Test if the list of features of a policy is handled correctly.
policy = {
- 'annotations': {
- 'features': {'spaceship_docking': 0, 'dynamic_refresh': 1}
- }
+ 'features': {'spaceship_docking': 0, 'dynamic_refresh': 1}
}
self.writer._FEATURE_MAP = {
'spaceship_docking': 'Spaceship Docking',
@@ -215,9 +213,7 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
def testAddListExample(self):
policy = {
'name': 'PolicyName',
- 'annotations': {
- 'example_value': ['Foo', 'Bar']
- }
+ 'example_value': ['Foo', 'Bar']
}
self.writer._AddListExample(self.doc_root, policy)
self.assertEquals(
@@ -248,9 +244,7 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
policy = {
'name': 'PolicyName',
'type': 'main',
- 'annotations': {
- 'example_value': True
- }
+ 'example_value': True
}
e1 = self.writer.AddElement(self.doc_root, 'e1')
self.writer._AddExample(e1, policy)
@@ -261,9 +255,7 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
policy = {
'name': 'PolicyName',
'type': 'main',
- 'annotations': {
- 'example_value': False
- }
+ 'example_value': False
}
e2 = self.writer.AddElement(self.doc_root, 'e2')
self.writer._AddExample(e2, policy)
@@ -276,9 +268,7 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
policy = {
'name': 'PolicyName',
'type': 'int-enum',
- 'annotations': {
- 'example_value': 16
- }
+ 'example_value': 16
}
self.writer._AddExample(self.doc_root, policy)
self.assertEquals(
@@ -290,9 +280,7 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
policy = {
'name': 'PolicyName',
'type': 'string-enum',
- 'annotations': {
- 'example_value': "wacky"
- }
+ 'example_value': "wacky"
}
self.writer._AddExample(self.doc_root, policy)
self.assertEquals(
@@ -304,9 +292,7 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
policy = {
'name': 'PolicyName',
'type': 'string',
- 'annotations': {
- 'example_value': 'awesome-example'
- }
+ 'example_value': 'awesome-example'
}
self.writer._AddExample(self.doc_root, policy)
self.assertEquals(
@@ -318,9 +304,7 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
policy = {
'name': 'PolicyName',
'type': 'int',
- 'annotations': {
- 'example_value': 26
- }
+ 'example_value': 26
}
self.writer._AddExample(self.doc_root, policy)
self.assertEquals(
@@ -351,10 +335,8 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
'since_version': '8',
'until_version': '',
}],
- 'annotations': {
- 'features': {'dynamic_refresh': 0},
- 'example_value': False
- }
+ 'features': {'dynamic_refresh': 0},
+ 'example_value': False
}
self.writer.messages['doc_since_version'] = {'text': '...$6...'}
self.writer._AddPolicyDetails(self.doc_root, policy)
@@ -380,11 +362,11 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
'</dl></root>')
def testAddPolicyNote(self):
+ # TODO(jkummerow): The functionality tested by this test is currently not
+ # used for anything and will probably soon be removed.
# Test if nodes are correctly added to policies.
policy = {
- 'annotations': {
- 'problem_href': 'http://www.example.com/5'
- }
+ 'problem_href': 'http://www.example.com/5'
}
self.writer.messages['doc_note'] = {'text': '...$6...'}
self.writer._AddPolicyNote(self.doc_root, policy)
@@ -440,10 +422,8 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
'since_version': '7',
'until_version': '',
}],
- 'annotations': {
- 'features': {'dynamic_refresh': 0},
- 'example_value': False
- }
+ 'features': {'dynamic_refresh': 0},
+ 'example_value': False
}
self.writer.messages['doc_since_version'] = {'text': '..$6..'}
self.writer._AddPolicySection(self.doc_root, policy)

Powered by Google App Engine
This is Rietveld 408576698