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

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

Issue 2432113002: [Findit] Add local_git_repository (Closed)
Patch Set: Fix nits. 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/test/repo_util_test.py
diff --git a/appengine/findit/common/test/repo_util_test.py b/appengine/findit/common/test/repo_util_test.py
index 696c6a34eed7047e790d920400f7e13d6ce563bf..790f85686f0b75c8aee90131b57982cca9baa186 100644
--- a/appengine/findit/common/test/repo_util_test.py
+++ b/appengine/findit/common/test/repo_util_test.py
@@ -4,6 +4,7 @@
import json
import StringIO
+import subprocess
from testing_utils import testing
import textwrap
import urllib2
@@ -133,3 +134,18 @@ class RepoUtilTest(testing.AppengineTestCase):
reverted_revision = repo_util.GetRevertedRevision(message)
self.assertIsNone(reverted_revision)
+
+ def testGetLocalGitCommandOutput(self):
+ class _MockProcess(object):
+ def __init__(self, command, *_):
+ self.command = command
+
+ def communicate(self, *_):
+ return self.command, 'dummy'
+
+ def _MockPopen(command, **_):
+ return _MockProcess(command)
+
+ self.mock(subprocess, 'Popen', _MockPopen)
+ output = repo_util.GetCommandOutput('command')
+ self.assertEqual(output, 'command')

Powered by Google App Engine
This is Rietveld 408576698