Index: chrome/common/extensions/docs/server2/integration_test.py |
diff --git a/chrome/common/extensions/docs/server2/integration_test.py b/chrome/common/extensions/docs/server2/integration_test.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..bf1350efe8664b1818f1870af4e12f0d2754da9d |
--- /dev/null |
+++ b/chrome/common/extensions/docs/server2/integration_test.py |
@@ -0,0 +1,49 @@ |
+#!/usr/bin/env python |
+# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import os |
+from StringIO import StringIO |
+import unittest |
+ |
+import server_instance |
+ |
+KNOWN_FAILURES = [ |
+ 'webstore.html', |
+] |
+ |
+class _MockResponse: |
+ def __init__(self): |
+ self.status = 200 |
+ self.out = StringIO() |
+ |
+ def set_status(self, status): |
+ self.status = status |
+ |
+class _MockRequest: |
+ def __init__(self): |
+ self.headers = {} |
+ |
+class IntegrationTest(unittest.TestCase): |
+ def setUp(self): |
+ self._instance = server_instance.GetInstanceForBranch('local', |
+ None, |
+ None, |
+ '../..') |
+ |
+ def testAll(self): |
+ for filename in os.listdir(os.path.join('templates', 'public')): |
+ if filename in KNOWN_FAILURES: |
+ continue |
+ response = _MockResponse() |
+ self._instance.Get(filename, _MockRequest(), response) |
+ self.assertEqual(200, response.status) |
not at google - send to devlin
2012/07/30 21:19:09
also assert that the response isn't empty?
cduvall
2012/07/30 22:48:09
Done.
|
+ |
+ def test404(self): |
+ bad_response = _MockResponse() |
+ self._instance.Get('junk', _MockRequest(), bad_response) |
+ self.assertEqual(404, bad_response.status) |
not at google - send to devlin
2012/07/30 21:19:09
ditto
cduvall
2012/07/30 22:48:09
Done.
|
+ |
+if __name__ == '__main__': |
+ unittest.main() |