OLD | NEW |
---|---|
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 Loading... | |
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() |
OLD | NEW |