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

Unified Diff: appengine/findit/handlers/crash/crash_handler.py

Issue 2605943002: Removing the mutation in the factories for getting dep repositories (Closed)
Patch Set: Created 4 years 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: appengine/findit/handlers/crash/crash_handler.py
diff --git a/appengine/findit/handlers/crash/crash_handler.py b/appengine/findit/handlers/crash/crash_handler.py
index b7f7efb5640478cc59842d7cd21164efac9c62fc..67a67b2b134304a126fbc0419767bdde46668e74 100644
--- a/appengine/findit/handlers/crash/crash_handler.py
+++ b/appengine/findit/handlers/crash/crash_handler.py
@@ -129,9 +129,10 @@ def ScheduleNewAnalysis(crash_data):
True if we started a new pipeline; False otherwise.
"""
client_id = crash_data['client_id']
- repository = CachedGitilesRepository(HttpClientAppengine())
+ def get_repository(repo_url): # pragma: no cover
Sharu Jiang 2016/12/28 23:05:12 This one is duplicate to the one in crash_pipeline
wrengr 2016/12/29 20:57:31 Done.
+ return CachedGitilesRepository(HttpClientAppengine(), repo_url)
# N.B., must call FinditForClientID indirectly, for mock testing.
- findit_client = crash_pipeline.FinditForClientID(client_id, repository)
+ findit_client = crash_pipeline.FinditForClientID(client_id, get_repository)
# Check policy and modify the crash_data as needed.
crash_data = findit_client.CheckPolicy(crash_data)

Powered by Google App Engine
This is Rietveld 408576698