Chromium Code Reviews| Index: src/caterpillar_test.py |
| diff --git a/src/caterpillar_test.py b/src/caterpillar_test.py |
| index ee71016c77aedf53ea9927e07109a2a111d18320..62d49d1bc09c271cfa79a2c3f048c05b0b121d34 100755 |
| --- a/src/caterpillar_test.py |
| +++ b/src/caterpillar_test.py |
| @@ -66,6 +66,7 @@ class TestCaseWithOutputDir(TestCaseWithTempDir): |
| caterpillar.setup_output_dir(MINIMAL_PATH, self.output_path, |
| BOILERPLATE_DIR) |
| + |
| # Test cases. |
| @@ -616,5 +617,33 @@ class TestEditCode(TestCaseWithOutputDir): |
| self.assertIn('<meta content="test233" name="name"', js_file.read()) |
| +class TestAddAppInfo(TestCaseWithOutputDir): |
| + """Tests add_app_info.""" |
| + |
| + def test_add_app_info(self): |
| + """Tests add_app_info writes the correct file.""" |
| + chrome_app_manifest = { |
| + 'app': {'background': {}}, |
| + 'name': 'tést app', |
| + } |
| + config = { |
| + 'id': 'asaasdásdasdasddsadsad', |
| + } |
| + |
| + caterpillar.add_app_info(self.output_path, chrome_app_manifest, config) |
| + |
| + with open(os.path.join(self.output_path, 'app.info.js')) as app_info_file: |
| + app_info_js = app_info_file.read().decode('utf-8') |
| + |
| + self.assertEqual(app_info_js, """chrome.caterpillar.manifest = { |
|
Matt Giuca
2016/01/28 07:33:22
"""\
Start on the next line.
Matthew Alger
2016/01/28 23:24:45
Done.
|
| + 'app': { |
| + 'background': {} |
| + }, |
| + 'name': 't\\u00e9st app' |
| +}; |
| +chrome.caterpillar.appId = 'asaasdásdasdasddsadsad'; |
| +""") |
| + |
| + |
| if __name__ == '__main__': |
| unittest.main() |