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

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

Issue 10825067: Extensions Docs Server: Apps samples page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed templates 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 side-by-side diff with in-line comments
Download patch
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
index 392337d28dc610a1fa66d7b2c3dd8bf621a679ec..2a5574e4aa4fcab5e3f09f711eb92ae933aec725 100755
--- a/chrome/common/extensions/docs/server2/integration_test.py
+++ b/chrome/common/extensions/docs/server2/integration_test.py
@@ -3,6 +3,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import logging
import os
from StringIO import StringIO
import unittest
@@ -10,8 +11,12 @@ import unittest
import appengine_memcache as memcache
import handler
from handler import Handler
+import url_constants
KNOWN_FAILURES = [
+ # Apps samples fails because it requires fetching data from github.com.
+ # This should be tested though: http://crbug.com/141910.
+ 'apps/samples.html',
]
class _MockResponse(object):
@@ -29,11 +34,14 @@ class _MockRequest(object):
class IntegrationTest(unittest.TestCase):
def testAll(self):
+ logging.getLogger().setLevel(logging.ERROR)
base_path = os.path.join('templates', 'public')
for path, dirs, files in os.walk(base_path):
for name in files:
filename = os.path.join(path, name)
- if name in KNOWN_FAILURES or '.' in path or name.startswith('.'):
+ if (filename.split('/', 2)[-1] in KNOWN_FAILURES or
+ '.' in path or
+ name.startswith('.')):
continue
request = _MockRequest(filename.split('/', 2)[-1])
response = _MockResponse()
@@ -61,7 +69,7 @@ class IntegrationTest(unittest.TestCase):
def testWarmupRequest(self):
for branch in ['dev', 'trunk', 'beta', 'stable']:
handler.BRANCH_UTILITY_MEMCACHE.Set(
- branch + '.' + handler.OMAHA_PROXY_URL,
+ branch + '.' + url_constants.OMAHA_PROXY_URL,
'local',
memcache.MEMCACHE_BRANCH_UTILITY)
request = _MockRequest('_ah/warmup')
@@ -70,7 +78,9 @@ class IntegrationTest(unittest.TestCase):
self.assertEqual(200, response.status)
# Test that the pages were rendered by checking the size of the output.
# In python 2.6 there is no 'assertGreater' method.
- self.assertTrue(len(response.out.getvalue()) > 500000)
+ value = response.out.getvalue()
+ self.assertTrue(len(value) > 100000,
+ msg='Response is too small, probably empty: %s' % value)
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « chrome/common/extensions/docs/server2/handler.py ('k') | chrome/common/extensions/docs/server2/memcache_file_system.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698