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

Unified Diff: appengine/findit/handlers/crash/test/fracas_crash_test.py

Issue 1940843003: [Findit] Use PubSub built-in authentication for push endpoint. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: fix nit. Created 4 years, 8 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
« no previous file with comments | « appengine/findit/handlers/crash/fracas_crash.py ('k') | appengine/findit/main.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/handlers/crash/test/fracas_crash_test.py
diff --git a/appengine/findit/handlers/crash/test/fracas_crash_test.py b/appengine/findit/handlers/crash/test/fracas_crash_test.py
index ba8bfebd22f7b89672debcafda328888fb75c3d6..0d817bef83a79334c6a6dd2ae956086cf6df6f4e 100644
--- a/appengine/findit/handlers/crash/test/fracas_crash_test.py
+++ b/appengine/findit/handlers/crash/test/fracas_crash_test.py
@@ -12,12 +12,11 @@ import webtest
from crash.test.crash_testcase import CrashTestCase
from handlers.crash import fracas_crash
-from model.crash.crash_config import CrashConfig
class FracasCrashTest(CrashTestCase):
app_module = webapp2.WSGIApplication([
- ('/crash/fracas', fracas_crash.FracasCrash),
+ ('/_ah/push-handlers/crash/fracas', fracas_crash.FracasCrash),
], debug=True)
def _MockScheduleNewAnalysisForCrash(self, requested_crashes):
@@ -26,19 +25,10 @@ class FracasCrashTest(CrashTestCase):
self.mock(fracas_crash.fracas_crash_pipeline, 'ScheduleNewAnalysisForCrash',
Mocked_ScheduleNewAnalysisForCrash)
- def testUnauthorizedToken(self):
- requested_crashes = []
- self._MockScheduleNewAnalysisForCrash(requested_crashes)
- self.assertRaisesRegexp(
- webtest.app.AppError,
- re.compile('.*403.* Unauthorized access: invalid token.*',
- re.MULTILINE | re.DOTALL),
- self.test_app.post, '/crash/fracas?token=UnauthorizedToken')
- self.assertEqual(0, len(requested_crashes))
-
def testAnalysisScheduled(self):
requested_crashes = []
self._MockScheduleNewAnalysisForCrash(requested_crashes)
+ self.mock_current_user(user_email='test@chromium.org', is_admin=True)
channel = 'supported_channel'
platform = 'supported_platform'
@@ -62,9 +52,8 @@ class FracasCrashTest(CrashTestCase):
'subscription': 'subscription',
}
- crash_config = CrashConfig.Get()
- token = crash_config.fracas.get('crash_data_push_token')
- self.test_app.post_json('/crash/fracas?token=%s' % token, request_json_data)
+ self.test_app.post_json('/_ah/push-handlers/crash/fracas',
+ request_json_data)
self.assertEqual(1, len(requested_crashes))
self.assertEqual(
« no previous file with comments | « appengine/findit/handlers/crash/fracas_crash.py ('k') | appengine/findit/main.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698