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, *_): |