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

Unified Diff: appengine/findit/crash/test/findit_for_chromecrash_test.py

Issue 2455053004: Moving ScheduleNewAnalysis to break the cycle (Closed)
Patch Set: rebase Created 4 years, 1 month 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/crash/test/findit_for_chromecrash_test.py
diff --git a/appengine/findit/crash/test/findit_for_chromecrash_test.py b/appengine/findit/crash/test/findit_for_chromecrash_test.py
index 40a43baf1f896be81412083bf53f246833a6dac0..e2edc1a62bbd10148c4103c10f8c4101f5912282 100644
--- a/appengine/findit/crash/test/findit_for_chromecrash_test.py
+++ b/appengine/findit/crash/test/findit_for_chromecrash_test.py
@@ -28,20 +28,13 @@ from model import analysis_status
from model.crash.crash_analysis import CrashAnalysis
from model.crash.fracas_crash_analysis import FracasCrashAnalysis
-# In production we'd use CrashWrapperPipeline. And that'd work fine here,
-# since we never actually call the method that uses it. But just to be
-# absolutely sure we don't go over the wire due to some mocking failure,
-# we'll use this dummy class instead. (In fact, since it's never used,
-# we don't even need to give a real class; ``None`` works just fine.)
-MOCK_PIPELINE_CLS = None
-
MOCK_REPOSITORY = None
class _FinditForChromeCrash(FinditForChromeCrash):
# We allow overriding the default MOCK_REPOSITORY because one unittest
# needs to.
def __init__(self, repository=MOCK_REPOSITORY):
- super(_FinditForChromeCrash, self).__init__(repository, MOCK_PIPELINE_CLS)
+ super(_FinditForChromeCrash, self).__init__(repository)
@classmethod
def _ClientID(cls): # pragma: no cover
@@ -70,7 +63,7 @@ class _FinditForChromeCrash(FinditForChromeCrash):
def _FinditForFracas():
"""A helper to pass in the standard pipeline class."""
- return FinditForFracas(MOCK_REPOSITORY, MOCK_PIPELINE_CLS)
+ return FinditForFracas(MOCK_REPOSITORY)
class FinditForChromeCrashTest(CrashTestCase):
@@ -176,35 +169,6 @@ class FinditForFracasTest(CrashTestCase):
analysis.put()
self.assertFalse(findit_client._NeedsNewAnalysis(crash_data))
- def testScheduleNewAnalysisSkipsUnsupportedChannel(self):
- self.assertFalse(_FinditForFracas().ScheduleNewAnalysis(DummyCrashData(
- version = None,
- signature = None,
- crash_identifiers = {},
- channel = 'unsupported_channel')))
-
- def testScheduleNewAnalysisSkipsUnsupportedPlatform(self):
- self.assertFalse(_FinditForFracas().ScheduleNewAnalysis(DummyCrashData(
- version = None,
- signature = None,
- platform = 'unsupported_platform',
- crash_identifiers = {})))
-
- def testScheduleNewAnalysisSkipsBlackListSignature(self):
- self.assertFalse(_FinditForFracas().ScheduleNewAnalysis(DummyCrashData(
- version = None,
- signature = 'Blacklist marker signature',
- crash_identifiers = {})))
-
- def testScheduleNewAnalysisSkipsIfAlreadyCompleted(self):
- findit_client = _FinditForFracas()
- crash_data = DummyCrashData()
- crash_identifiers = crash_data['crash_identifiers']
- analysis = findit_client.CreateAnalysis(crash_identifiers)
- analysis.status = analysis_status.COMPLETED
- analysis.put()
- self.assertFalse(findit_client.ScheduleNewAnalysis(crash_data))
-
def testFindCulpritForChromeCrashEmptyStacktrace(self):
self.mock(chrome_dependency_fetcher.ChromeDependencyFetcher,
'GetDependency', lambda *_: {})

Powered by Google App Engine
This is Rietveld 408576698