Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3567)

Unified Diff: chrome/common/extensions/docs/server2/handler_test.py

Issue 15009006: Docserver: refactor Servlet, ObjectStore, and ServerInstance architecture to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cduvall, redirect fix Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/handler_test.py
diff --git a/chrome/common/extensions/docs/server2/handler_test.py b/chrome/common/extensions/docs/server2/handler_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..085412fed5ca1a96cc79d66f00d775a3b0a8c21a
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/handler_test.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+# Copyright 2013 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 unittest
+
+from fake_fetchers import ConfigureFakeFetchers
+from handler import Handler
+from servlet import Request
+
+class HandlerTest(unittest.TestCase):
+ def setUp(self):
+ ConfigureFakeFetchers()
+
+ def testCodeGoogleRedirect(self):
+ response = Handler(Request('chrome/extensions/storage.html',
+ 'http://code.google.com',
+ {})).Get()
+ self.assertEqual(302, response.status)
+ self.assertEqual('http://developer.chrome.com/extensions/storage.html',
+ response.headers.get('Location'))
+
+ def testDeveloperGoogleRedirect(self):
+ response = Handler(Request.ForTest('')).Get()
+ self.assertEqual(302, response.status)
+ self.assertEqual('http://developer.google.com/chrome',
+ response.headers.get('Location'))
+
+ def testAppRedirect(self):
+ response = Handler(Request.ForTest('apps.html')).Get()
+ self.assertEqual(302, response.status)
+ self.assertEqual('/apps/about_apps.html', response.headers.get('Location'))
+
+if __name__ == '__main__':
+ unittest.main()

Powered by Google App Engine
This is Rietveld 408576698