Index: src/caterpillar_test.py |
diff --git a/src/caterpillar_test.py b/src/caterpillar_test.py |
index 7ae50ff8e5beea0534d317deabb129782c30abbd..9ba0addbcd3ca0d4e422770504e31c00105d16e4 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. |
@@ -617,5 +618,30 @@ chrome.app.runtime.onLaunched.addListener(function() { |
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', |
+ } |
+ |
+ caterpillar.add_app_info(self.output_path, chrome_app_manifest) |
+ |
+ 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 = { |
+ 'app': { |
+ 'background': {} |
+ }, |
+ 'name': 't\\u00e9st app' |
+}; |
+""") |
+ |
+ |
if __name__ == '__main__': |
unittest.main() |