| Index: appengine/findit/handlers/test/build_failure_test.py
|
| diff --git a/appengine/findit/handlers/test/build_failure_test.py b/appengine/findit/handlers/test/build_failure_test.py
|
| index 71399d30a60bafc00a27cc7750f31e7e1691aa28..ed0608dd975f5bc25c1d22c18261015bcc1ca3e9 100644
|
| --- a/appengine/findit/handlers/test/build_failure_test.py
|
| +++ b/appengine/findit/handlers/test/build_failure_test.py
|
| @@ -6,24 +6,22 @@ import os
|
| import re
|
|
|
| from google.appengine.ext import testbed
|
| +
|
| import webapp2
|
| import webtest
|
|
|
| -from testing_utils import testing
|
| -
|
| from handlers import build_failure
|
| -from model.wf_analysis import WfAnalysis
|
| from model import wf_analysis_status
|
| +from model.wf_analysis import WfAnalysis
|
| from waterfall import buildbot
|
| -from waterfall import waterfall_config
|
| -
|
| +from waterfall.test import wf_testcase
|
|
|
| # Root directory appengine/findit.
|
| ROOT_DIR = os.path.join(os.path.dirname(__file__),
|
| os.path.pardir, os.path.pardir)
|
|
|
|
|
| -class BuildFailureTest(testing.AppengineTestCase):
|
| +class BuildFailureTest(wf_testcase.WaterfallTestCase):
|
| app_module = webapp2.WSGIApplication([
|
| ('/build-failure', build_failure.BuildFailure),
|
| ], debug=True)
|
| @@ -74,17 +72,12 @@ class BuildFailureTest(testing.AppengineTestCase):
|
| self.test_app.get, '/build-failure', params={'url': build_url})
|
|
|
| def testNonAdminCanViewAnalysisOfFailureOnUnsupportedMaster(self):
|
| - master_name = 'm'
|
| + master_name = 'm2'
|
| builder_name = 'b 1'
|
| build_number = 123
|
| build_url = buildbot.CreateBuildUrl(
|
| master_name, builder_name, build_number)
|
|
|
| - def MockMasterIsSupported(*_):
|
| - return False
|
| - self.mock(waterfall_config, 'MasterIsSupported',
|
| - MockMasterIsSupported)
|
| -
|
| analysis = WfAnalysis.Create(master_name, builder_name, build_number)
|
| analysis.status = wf_analysis_status.ANALYZED
|
| analysis.put()
|
| @@ -95,16 +88,12 @@ class BuildFailureTest(testing.AppengineTestCase):
|
| self.assertEqual(0, len(self.taskqueue_stub.get_filtered_tasks()))
|
|
|
| def testNonAdminCannotRequestAnalysisOfFailureOnUnsupportedMaster(self):
|
| - master_name = 'm'
|
| + master_name = 'm2'
|
| builder_name = 'b 1'
|
| build_number = 123
|
| build_url = buildbot.CreateBuildUrl(
|
| master_name, builder_name, build_number)
|
|
|
| - def MockMasterIsSupported(*_):
|
| - return False
|
| - self.mock(waterfall_config, 'MasterIsSupported', MockMasterIsSupported)
|
| -
|
| self.assertRaisesRegexp(
|
| webtest.app.AppError,
|
| re.compile('.*501 Not Implemented.*Master "%s" '
|
| @@ -113,16 +102,12 @@ class BuildFailureTest(testing.AppengineTestCase):
|
| self.test_app.get, '/build-failure', params={'url': build_url})
|
|
|
| def testAdminCanRequestAnalysisOfFailureOnUnsupportedMaster(self):
|
| - master_name = 'm'
|
| + master_name = 'm2'
|
| builder_name = 'b'
|
| build_number = 123
|
| build_url = buildbot.CreateBuildUrl(
|
| master_name, builder_name, build_number)
|
|
|
| - def MockMasterIsSupported(*_):
|
| - return False
|
| - self.mock(waterfall_config, 'MasterIsSupported', MockMasterIsSupported)
|
| -
|
| self.mock_current_user(user_email='test@chromium.org', is_admin=True)
|
|
|
| response = self.test_app.get('/build-failure', params={'url': build_url})
|
| @@ -137,10 +122,6 @@ class BuildFailureTest(testing.AppengineTestCase):
|
| build_url = buildbot.CreateBuildUrl(
|
| master_name, builder_name, build_number)
|
|
|
| - def MockMasterIsSupported(*_):
|
| - return True
|
| - self.mock(waterfall_config, 'MasterIsSupported', MockMasterIsSupported)
|
| -
|
| response = self.test_app.get('/build-failure', params={'url': build_url})
|
| self.assertEquals(200, response.status_int)
|
|
|
|
|