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

Unified Diff: appengine/findit/common/test/chromium_deps_test.py

Issue 2344443005: [Findit] Factoring the gitiles (etc) stuff out into its own directory (Closed)
Patch Set: rebase-update Created 4 years, 3 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/common/test/chromium_deps_test.py
diff --git a/appengine/findit/common/test/chromium_deps_test.py b/appengine/findit/common/test/chromium_deps_test.py
index c217f8fbdb5251e37746fcdfed1ef7cdc27d9bac..f6f41627c67608491b5e7bac00a612d43c96b144 100644
--- a/appengine/findit/common/test/chromium_deps_test.py
+++ b/appengine/findit/common/test/chromium_deps_test.py
@@ -7,16 +7,24 @@ import collections
from testing_utils import testing
+from gitiles import git_repository
from common import chromium_deps
from common import deps_parser
-from common import git_repository
-from common import repository
from common import retry_http_client
from common import http_client_appengine
from common.dependency import Dependency, DependencyRoll
-class DummyGitRepository(repository.Repository):
+class DummyGitRepository(object):
+ """A class for mocking GitRepository.
+
+ N.B., in order to use this class for mocking, every module we want to
+ test with a mock GitRepository must not import that class directly.
+ Instead they must import the git_repository module and rely on dynamic
+ dispatch to resolve the GitRepository attribute. Otherwise those
+ modules will hold direct links to the real GitRepository class, and
+ so won't dispatch into this mock class for our unit tests."""
+
RESPONSES = {}
def __init__(self, *_):

Powered by Google App Engine
This is Rietveld 408576698