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

Unified Diff: appengine/findit/common/findit_testcase.py

Issue 2521773004: [Culprit-finder] Refactor findit testcase and move it to libs. (Closed)
Patch Set: . 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
« no previous file with comments | « no previous file | appengine/findit/crash/test/crash_testcase.py » ('j') | appengine/findit/libs/testcase.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/common/findit_testcase.py
diff --git a/appengine/findit/common/findit_testcase.py b/appengine/findit/common/findit_testcase.py
deleted file mode 100644
index 75f15506783728426a9c81ef76f1cd0a28ca90ba..0000000000000000000000000000000000000000
--- a/appengine/findit/common/findit_testcase.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-
-from testing_utils import testing
-
-from lib import time_util
-
-
-class FinditTestCase(testing.AppengineTestCase): # pragma: no cover.
- # Setup the customized queues.
- taskqueue_stub_root_path = os.path.join(
- os.path.dirname(__file__), os.path.pardir)
-
- def MockPipeline(
- self, pipeline_class, result, expected_args, expected_kwargs=None):
- """Mocks a pipeline to return a value and asserts the expected parameters.
-
- Args:
- pipeline_class (class): The class of the pipeline to be mocked.
- result (object): The result to be returned by the pipeline.
- expected_args (list): The list of positional parameters expected by the
- pipeline.
- expected_kwargs (dict): The dict of key-value parameters expected by the
- pipeline. Default is None.
- """
- expected_kwargs = expected_kwargs or {}
-
- def Mocked_run(_, *args, **kwargs):
- self.assertEqual(list(args), expected_args)
- self.assertEqual(kwargs, expected_kwargs)
- return result
-
- self.mock(pipeline_class, 'run', Mocked_run)
-
- def MockUTCNow(self, mocked_utcnow):
- """Mocks utcnow with the given value for testing."""
- self.mock(time_util, 'GetUTCNow', lambda: mocked_utcnow)
-
- def MockUTCNowWithTimezone(self, mocked_utcnow):
- """Mocks utcnow with the given value for testing."""
- self.mock(time_util, 'GetUTCNowWithTimezone', lambda: mocked_utcnow)
« no previous file with comments | « no previous file | appengine/findit/crash/test/crash_testcase.py » ('j') | appengine/findit/libs/testcase.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698