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

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

Issue 2344443005: [Findit] Factoring the gitiles (etc) stuff out into its own directory (Closed)
Patch Set: moving ./gitiles to ./lib/gitiles Created 4 years, 2 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/chromium_deps.py
diff --git a/appengine/findit/common/chromium_deps.py b/appengine/findit/common/chromium_deps.py
index 39c63472fa5e4b9e3d052d27103ea0f746e9eb9d..794b32738414ec06ad8ffb93f0e343e2b4162e45 100644
--- a/appengine/findit/common/chromium_deps.py
+++ b/appengine/findit/common/chromium_deps.py
@@ -4,9 +4,17 @@
import re
+# N.B., in order for our mocking framework to work correctly, we *must not*
+# import the GitRepository class directly; instead, we must only import
+# the git_repository module and then rely on dynamic dispatch to resolve
+# the module's GitRepository attribute. Otherwise the DEPSDownloader.Load
+# method will hold a reference directly to the real GitRepository class,
+# which means we can't swap it out for the DummyGitRepository class, which
+# in turn will cause some unit tests to fail (since we can't mock the
+# responses of doing SSL stuff).
+from lib.gitiles import git_repository
from common import dependency
from common import deps_parser
-from common import git_repository
from common import http_client_appengine
@@ -30,6 +38,9 @@ def IsChromeVersion(revision):
class DEPSDownloader(deps_parser.DEPSLoader):
"""Downloads DEPS from remote Git repo."""
+ # TODO(wrengr): why do we allocate a new GitRepository every time
+ # we call Load, rather than just doing it once and saving it in the
+ # DEPSDownloader class (via RAII)?
def Load(self, repo_url, revision, deps_file):
http_client = http_client_appengine.HttpClientAppengine()
repo = git_repository.GitRepository(repo_url, http_client)

Powered by Google App Engine
This is Rietveld 408576698