| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import unittest | 6 import unittest |
| 7 | 7 |
| 8 from extensions_paths import EXAMPLES, PUBLIC_TEMPLATES, STATIC_DOCS | 8 from extensions_paths import EXAMPLES, PUBLIC_TEMPLATES, STATIC_DOCS |
| 9 from local_file_system import LocalFileSystem | 9 from local_file_system import LocalFileSystem |
| 10 from render_servlet import RenderServlet | 10 from render_servlet import RenderServlet |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 self.assertEqual(ReadFile('%s/%s' % (EXAMPLES, sample_file)), | 69 self.assertEqual(ReadFile('%s/%s' % (EXAMPLES, sample_file)), |
| 70 response.content.ToString()) | 70 response.content.ToString()) |
| 71 | 71 |
| 72 def testSampleZip(self): | 72 def testSampleZip(self): |
| 73 sample_dir = 'extensions/talking_alarm_clock' | 73 sample_dir = 'extensions/talking_alarm_clock' |
| 74 response = self._Render('extensions/examples/%s.zip' % sample_dir) | 74 response = self._Render('extensions/examples/%s.zip' % sample_dir) |
| 75 self.assertEqual(200, response.status) | 75 self.assertEqual(200, response.status) |
| 76 self.assertEqual('application/zip', response.headers['Content-Type']) | 76 self.assertEqual('application/zip', response.headers['Content-Type']) |
| 77 | 77 |
| 78 def testStaticFile(self): | 78 def testStaticFile(self): |
| 79 static_file = 'css/site.css' | 79 static_file = 'css/out/site.css' |
| 80 response = self._Render('static/%s' % static_file) | 80 response = self._Render('static/%s' % static_file) |
| 81 self.assertEqual(200, response.status) | 81 self.assertEqual(200, response.status) |
| 82 self.assertEqual('text/css; charset=utf-8', | 82 self.assertEqual('text/css; charset=utf-8', |
| 83 response.headers['Content-Type']) | 83 response.headers['Content-Type']) |
| 84 self.assertEqual(ReadFile('%s/%s' % (STATIC_DOCS, static_file)), | 84 self.assertEqual(ReadFile('%s/%s' % (STATIC_DOCS, static_file)), |
| 85 response.content.ToString()) | 85 response.content.ToString()) |
| 86 | 86 |
| 87 def testHtmlTemplate(self): | 87 def testHtmlTemplate(self): |
| 88 html_file = 'extensions/storage.html' | 88 html_file = 'extensions/storage.html' |
| 89 response = self._Render(html_file) | 89 response = self._Render(html_file) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 108 response.GetRedirect()) | 108 response.GetRedirect()) |
| 109 | 109 |
| 110 def testOtherRedirectsJsonRedirect(self): | 110 def testOtherRedirectsJsonRedirect(self): |
| 111 response = self._Render('apps/webview_tag.html') | 111 response = self._Render('apps/webview_tag.html') |
| 112 self.assertEqual(('/apps/tags/webview.html', False), | 112 self.assertEqual(('/apps/tags/webview.html', False), |
| 113 response.GetRedirect()) | 113 response.GetRedirect()) |
| 114 | 114 |
| 115 | 115 |
| 116 if __name__ == '__main__': | 116 if __name__ == '__main__': |
| 117 unittest.main() | 117 unittest.main() |
| OLD | NEW |