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

Side by Side Diff: grit/format/policy_templates/writers/doc_writer_unittest.py

Issue 512733004: Fixed the example JSON strings for Windows and Linux. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « grit/format/policy_templates/writers/doc_writer.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 '''Unit tests for grit.format.policy_templates.writers.doc_writer''' 6 '''Unit tests for grit.format.policy_templates.writers.doc_writer'''
7 7
8 8
9 import json
9 import os 10 import os
10 import sys 11 import sys
11 if __name__ == '__main__': 12 if __name__ == '__main__':
12 sys.path.append(os.path.join(os.path.dirname(__file__), '../../../..')) 13 sys.path.append(os.path.join(os.path.dirname(__file__), '../../../..'))
13 14
14 import unittest 15 import unittest
15 from xml.dom import minidom 16 from xml.dom import minidom
16 17
17 from grit.format.policy_templates.writers import writer_unittest_common 18 from grit.format.policy_templates.writers import writer_unittest_common
18 from grit.format.policy_templates.writers import doc_writer 19 from grit.format.policy_templates.writers import doc_writer
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 "A": 1, 682 "A": 1,
682 "B": 2, 683 "B": 2,
683 }, { 684 }, {
684 "C": 3, 685 "C": 3,
685 "D": 4, 686 "D": 4,
686 }, 687 },
687 ], 688 ],
688 }, 689 },
689 } 690 }
690 self.writer._AddDictionaryExample(self.doc_root, policy) 691 self.writer._AddDictionaryExample(self.doc_root, policy)
691 value = str(policy['example_value']) 692 value = json.dumps(policy['example_value']).replace('"', '"')
692 self.assertEquals( 693 self.assertEquals(
693 self.doc_root.toxml(), 694 self.doc_root.toxml(),
694 '<root>' 695 '<root>'
695 '<dl style="style_dd dl;">' 696 '<dl style="style_dd dl;">'
696 '<dt>Windows:</dt>' 697 '<dt>Windows:</dt>'
697 '<dd style="style_.monospace;style_.pre;">MockKey\PolicyName = ' 698 '<dd style="style_.monospace;style_.pre;">MockKey\PolicyName = '
698 '&quot;' + value + '&quot;' 699 + value +
699 '</dd>' 700 '</dd>'
700 '<dt>Linux:</dt>' 701 '<dt>Linux:</dt>'
701 '<dd style="style_.monospace;">PolicyName: ' + value + '</dd>' 702 '<dd style="style_.monospace;">PolicyName: ' + value + '</dd>'
702 '<dt>Mac:</dt>' 703 '<dt>Mac:</dt>'
703 '<dd style="style_.monospace;style_.pre;">' 704 '<dd style="style_.monospace;style_.pre;">'
704 '&lt;key&gt;PolicyName&lt;/key&gt;\n' 705 '&lt;key&gt;PolicyName&lt;/key&gt;\n'
705 '&lt;dict&gt;\n' 706 '&lt;dict&gt;\n'
706 ' &lt;key&gt;DictList&lt;/key&gt;\n' 707 ' &lt;key&gt;DictList&lt;/key&gt;\n'
707 ' &lt;array&gt;\n' 708 ' &lt;array&gt;\n'
708 ' &lt;dict&gt;\n' 709 ' &lt;dict&gt;\n'
(...skipping 24 matching lines...) Expand all
733 ' &lt;key&gt;True&lt;/key&gt;\n' 734 ' &lt;key&gt;True&lt;/key&gt;\n'
734 ' &lt;true/&gt;\n' 735 ' &lt;true/&gt;\n'
735 '&lt;/dict&gt;' 736 '&lt;/dict&gt;'
736 '</dd>' 737 '</dd>'
737 '</dl>' 738 '</dl>'
738 '</root>') 739 '</root>')
739 740
740 741
741 if __name__ == '__main__': 742 if __name__ == '__main__':
742 unittest.main() 743 unittest.main()
OLDNEW
« no previous file with comments | « grit/format/policy_templates/writers/doc_writer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698