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

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

Issue 2605943002: Removing the mutation in the factories for getting dep repositories (Closed)
Patch Set: rebase Created 3 years, 12 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: appengine/findit/handlers/crash/test/crash_handler_test.py
diff --git a/appengine/findit/handlers/crash/test/crash_handler_test.py b/appengine/findit/handlers/crash/test/crash_handler_test.py
index 1c50b64d9f74d26ab4f032bc616fbbc5f1e2175d..52b99054bc498a203319b6df00f67f2a6afe000e 100644
--- a/appengine/findit/handlers/crash/test/crash_handler_test.py
+++ b/appengine/findit/handlers/crash/test/crash_handler_test.py
@@ -25,6 +25,9 @@ from model import analysis_status
from model.crash.fracas_crash_analysis import FracasCrashAnalysis
+MOCK_GET_REPOSITORY = lambda _: None # pragma: no cover
+
+
class MockCulprit(object):
"""Construct a fake culprit where ``ToDicts`` returns whatever we please."""
@@ -44,7 +47,7 @@ class CrashHandlerTest(PredatorTestCase):
def testScheduleNewAnalysisWithFailingPolicy(self):
class _MockFindit(Findit): # pylint: disable=W0223
def __init__(self):
- super(_MockFindit, self).__init__(None)
+ super(_MockFindit, self).__init__(MOCK_GET_REPOSITORY)
def CheckPolicy(self, crash_data):
"""This is the same as inherited, but just to be explicit."""
@@ -70,7 +73,7 @@ class CrashHandlerTest(PredatorTestCase):
testcase = self
class _MockFindit(Findit): # pylint: disable=W0223
def __init__(self):
- super(_MockFindit, self).__init__(None)
+ super(_MockFindit, self).__init__(MOCK_GET_REPOSITORY)
@property
def config(self):
@@ -119,7 +122,7 @@ class CrashHandlerTest(PredatorTestCase):
crash_identifiers = {})))
def testScheduleNewAnalysisSkipsIfAlreadyCompleted(self):
- findit_client = FinditForFracas(None)
+ findit_client = FinditForFracas(MOCK_GET_REPOSITORY)
crash_data = DummyCrashData(client_id = findit_client.client_id)
crash_identifiers = crash_data['crash_identifiers']
analysis = findit_client.CreateAnalysis(crash_identifiers)
« no previous file with comments | « appengine/findit/handlers/crash/crash_handler.py ('k') | appengine/findit/libs/gitiles/gitiles_repository.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698