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

Side by Side Diff: chrome/common/extensions/docs/server2/integration_test.py

Issue 10828042: Extensions Docs Server: Integration testing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved logic into server instance Created 8 years, 4 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 (c) 2012 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 os
7 from StringIO import StringIO
8 import unittest
9
10 import server_instance
11
12 KNOWN_FAILURES = [
13 'webstore.html',
14 ]
15
16 class _MockResponse:
17 def __init__(self):
18 self.status = 200
19 self.out = StringIO()
20
21 def set_status(self, status):
22 self.status = status
23
24 class _MockRequest:
25 def __init__(self):
26 self.headers = {}
27
28 class IntegrationTest(unittest.TestCase):
29 def setUp(self):
30 self._instance = server_instance.GetInstanceForBranch('local',
31 None,
32 None,
33 '../..')
34
35 def testAll(self):
36 for filename in os.listdir(os.path.join('templates', 'public')):
37 if filename in KNOWN_FAILURES:
38 continue
39 response = _MockResponse()
40 self._instance.Get(filename, _MockRequest(), response)
41 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.
42
43 def test404(self):
44 bad_response = _MockResponse()
45 self._instance.Get('junk', _MockRequest(), bad_response)
46 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.
47
48 if __name__ == '__main__':
49 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698