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

Unified Diff: grit/format/policy_templates/writers/json_writer_unittest.py

Issue 14940026: Fixes the policy template generator to work predictably even with Python hash randomization turned … (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 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: grit/format/policy_templates/writers/json_writer_unittest.py
===================================================================
--- grit/format/policy_templates/writers/json_writer_unittest.py (revision 119)
+++ grit/format/policy_templates/writers/json_writer_unittest.py (working copy)
@@ -243,9 +243,6 @@
'b': 2,
}
}
- # Encode |value| here, to make sure the string encoded within the reg_writer
- # and the expected value are the same.
- value = str(example)
grd = self.PrepareTest(
'{'
' "policy_definitions": ['
@@ -255,7 +252,7 @@
' "caption": "Example Dictionary Policy",'
' "desc": "Example Dictionary Policy",'
' "supported_on": ["chrome.linux:8-"],'
- ' "example_value": ' + value +
+ ' "example_value": ' + str(example) +
' },'
' ],'
' "placeholders": [],'
@@ -267,7 +264,8 @@
' // Example Dictionary Policy\n' +
HEADER_DELIMETER +
' // Example Dictionary Policy\n\n'
- ' //"DictionaryPolicy": ' + str(eval(value)) + '\n\n'
+ ' //"DictionaryPolicy": {\'bool\': True, \'dict\': {\'a\': 1, '
+ '\'b\': 2}, \'int\': 10, \'list\': [1, 2, 3], \'string\': \'abc\'}\n\n'
'}')
self.CompareOutputs(output, expected_output)
« no previous file with comments | « grit/format/policy_templates/policy_template_generator.py ('k') | grit/format/policy_templates/writers/reg_writer_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698