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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/env python
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
4 # found in the LICENSE file.
5
6 import unittest
7
8 from fake_fetchers import ConfigureFakeFetchers
9 from handler import Handler
10 from servlet import Request
11
12 class HandlerTest(unittest.TestCase):
13 def setUp(self):
14 ConfigureFakeFetchers()
15
16 def testCodeGoogleRedirect(self):
17 response = Handler(Request('chrome/extensions/storage.html',
18 'http://code.google.com',
19 {})).Get()
20 self.assertEqual(302, response.status)
21 self.assertEqual('http://developer.chrome.com/extensions/storage.html',
22 response.headers.get('Location'))
23
24 def testDeveloperGoogleRedirect(self):
25 response = Handler(Request.ForTest('')).Get()
26 self.assertEqual(302, response.status)
27 self.assertEqual('http://developer.google.com/chrome',
28 response.headers.get('Location'))
29
30 def testAppRedirect(self):
31 response = Handler(Request.ForTest('apps.html')).Get()
32 self.assertEqual(302, response.status)
33 self.assertEqual('/apps/about_apps.html', response.headers.get('Location'))
34
35 if __name__ == '__main__':
36 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698