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

Side by Side Diff: pylib/gyp/easy_xml_test.py

Issue 1454433002: Python 3 compatibility Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Rebase with master (4ec6c4e3a94bd04a6da2858163d40b2429b8aad1) Created 4 years, 8 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2011 Google Inc. All rights reserved. 3 # Copyright (c) 2011 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """ Unit tests for the easy_xml.py file. """ 7 """ Unit tests for the easy_xml.py file. """
8 8
9 import gyp.easy_xml as easy_xml 9 import gyp.easy_xml as easy_xml
10 import unittest 10 import unittest
11 import StringIO 11 try:
12 from StringIO import StringIO
13 except ImportError:
14 from io import StringIO
12 15
13 16
14 class TestSequenceFunctions(unittest.TestCase): 17 class TestSequenceFunctions(unittest.TestCase):
15 18
16 def setUp(self): 19 def setUp(self):
17 self.stderr = StringIO.StringIO() 20 self.stderr = StringIO()
18 21
19 def test_EasyXml_simple(self): 22 def test_EasyXml_simple(self):
20 self.assertEqual( 23 self.assertEqual(
21 easy_xml.XmlToString(['test']), 24 easy_xml.XmlToString(['test']),
22 '<?xml version="1.0" encoding="utf-8"?><test/>') 25 '<?xml version="1.0" encoding="utf-8"?><test/>')
23 26
24 self.assertEqual( 27 self.assertEqual(
25 easy_xml.XmlToString(['test'], encoding='Windows-1252'), 28 easy_xml.XmlToString(['test'], encoding='Windows-1252'),
26 '<?xml version="1.0" encoding="Windows-1252"?><test/>') 29 '<?xml version="1.0" encoding="Windows-1252"?><test/>')
27 30
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 'Label': 'Configuration'}, 97 'Label': 'Configuration'},
95 ['ConfigurationType', 'Application'], 98 ['ConfigurationType', 'Application'],
96 ['CharacterSet', 'Unicode'] 99 ['CharacterSet', 'Unicode']
97 ] 100 ]
98 ]) 101 ])
99 self.assertEqual(xml, target) 102 self.assertEqual(xml, target)
100 103
101 104
102 if __name__ == '__main__': 105 if __name__ == '__main__':
103 unittest.main() 106 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698