def test_meta_tags(self): """Tests that meta tags are inserted into HTML files.""" chrome_app_manifest = {'app': {'background': {}}, 'name': 'test233'} caterpillar.edit_code(self.output_path, [], chrome_app_manifest, {'boilerplate_dir': BOILERPLATE_DIR}) with codecs.open(os.path.join(self.output_path, 'my índex.html'), encoding='utf-8') as js_file: self.assertIn('<meta content="test233" name="name"', js_file.read())
def test_meta_tags(self): """Tests that meta tags are inserted into HTML files.""" chrome_app_manifest = { 'app': {'background': {}}, 'name': 'test233' } caterpillar.edit_code(self.output_path, [], chrome_app_manifest, {'boilerplate_dir': BOILERPLATE_DIR}) with codecs.open(os.path.join(self.output_path, 'my índex.html'), encoding='utf-8') as js_file: self.assertIn('<meta content="test233" name="name"', js_file.read())
def test_script_tags(self): """Tests that script tags are inserted into HTML files.""" chrome_app_manifest = {'app': {'background': {}}} caterpillar.edit_code(self.output_path, ['tést.js'], chrome_app_manifest, {'boilerplate_dir': BOILERPLATE_DIR}) with codecs.open(os.path.join(self.output_path, 'my índex.html'), encoding='utf-8') as js_file: self.assertIn( '<script src="{}"'.format( os.path.join('.', BOILERPLATE_DIR, 'tést.js')), js_file.read())
def test_script_tags(self): """Tests that script tags are inserted into HTML files.""" chrome_app_manifest = { 'app': {'background': {}} } caterpillar.edit_code(self.output_path, ['tést.js'], chrome_app_manifest, {'boilerplate_dir': BOILERPLATE_DIR}) with codecs.open(os.path.join(self.output_path, 'my índex.html'), encoding='utf-8') as js_file: self.assertIn( '<script src="{}"'.format( os.path.join('.', BOILERPLATE_DIR, 'tést.js')), js_file.read())
def test_todos(self): """Tests that TODOs are inserted into JS files.""" chrome_app_manifest = {'app': {'background': {}}} caterpillar.edit_code(self.output_path, [], chrome_app_manifest, {'boilerplate_dir': BOILERPLATE_DIR}) with codecs.open(os.path.join(self.output_path, 'my scrípt.js'), encoding='utf-8') as js_file: self.assertEqual( js_file.read(), """// TODO(Caterpillar): Check usage of app.runtime.onLaunched.addListener. chrome.app.runtime.onLaunched.addListener(function() { // TODO(Caterpillar): Check usage of app.window.create. chrome.app.window.create('my índex.html'); }); """)
def test_todos(self): """Tests that TODOs are inserted into JS files.""" chrome_app_manifest = { 'app': {'background': {}} } caterpillar.edit_code(self.output_path, [], chrome_app_manifest, {'boilerplate_dir': BOILERPLATE_DIR}) with codecs.open(os.path.join(self.output_path, 'my scrípt.js'), encoding='utf-8') as js_file: self.assertEqual(js_file.read(), """// TODO(Caterpillar): Check usage of app.runtime.onLaunched.addListener. chrome.app.runtime.onLaunched.addListener(function() { // TODO(Caterpillar): Check usage of app.window.create. chrome.app.window.create('my índex.html'); }); """)