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

Side by Side Diff: src/caterpillar_test.py

Issue 1665103002: Removed replacing double- with single-quotes in app.info generation. Resolves #40. (Closed) Base URL: https://github.com/chromium/caterpillar.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « src/caterpillar.py ('k') | tests/test_app_tts_output/app.info.js » ('j') | 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 python2 1 #!/usr/bin/env python2
2 # -*- coding: utf-8 -*- 2 # -*- coding: utf-8 -*-
3 3
4 # Copyright 2016 Google Inc. All Rights Reserved. 4 # Copyright 2016 Google Inc. All Rights Reserved.
5 # 5 #
6 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License. 7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at 8 # You may obtain a copy of the License at
9 # 9 #
10 # http://www.apache.org/licenses/LICENSE-2.0 10 # http://www.apache.org/licenses/LICENSE-2.0
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 self.assertIn('<meta content="test233" name="name"', js_file.read()) 680 self.assertIn('<meta content="test233" name="name"', js_file.read())
681 681
682 682
683 class TestAddAppInfo(TestCaseWithOutputDir): 683 class TestAddAppInfo(TestCaseWithOutputDir):
684 """Tests add_app_info.""" 684 """Tests add_app_info."""
685 685
686 def test_add_app_info(self): 686 def test_add_app_info(self):
687 """Tests add_app_info writes the correct file.""" 687 """Tests add_app_info writes the correct file."""
688 chrome_app_manifest = { 688 chrome_app_manifest = {
689 'app': {'background': {}}, 689 'app': {'background': {}},
690 'name': 'tést app', 690 'name': 'tést app\'',
Matt Giuca 2016/02/04 05:12:28 Good!
691 } 691 }
692 692
693 caterpillar.add_app_info(self.output_path, chrome_app_manifest) 693 caterpillar.add_app_info(self.output_path, chrome_app_manifest)
694 694
695 with open(os.path.join(self.output_path, 'app.info.js')) as app_info_file: 695 with open(os.path.join(self.output_path, 'app.info.js')) as app_info_file:
696 app_info_js = app_info_file.read().decode('utf-8') 696 app_info_js = app_info_file.read().decode('utf-8')
697 697
698 self.assertEqual(app_info_js, """\ 698 self.assertEqual(app_info_js, """\
699 chrome.caterpillar.manifest = { 699 chrome.caterpillar.manifest = {
700 'app': { 700 "app": {
701 'background': {} 701 "background": {}
702 }, 702 },
703 'name': 't\\u00e9st app' 703 "name": "t\\u00e9st app'"
704 }; 704 };
705 """) 705 """)
706 706
707 707
708 if __name__ == '__main__': 708 if __name__ == '__main__':
709 unittest.main() 709 unittest.main()
OLDNEW
« no previous file with comments | « src/caterpillar.py ('k') | tests/test_app_tts_output/app.info.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698