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

Unified Diff: tests/checkout_test.py

Issue 6891003: Add post_process argument to Checkout.apply_patch(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: post_processor Created 9 years, 8 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
« no previous file with comments | « patch.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/checkout_test.py
diff --git a/tests/checkout_test.py b/tests/checkout_test.py
index 749e638ee9eb11ca472428121748b2ede9f58d3b..16d4d1d112bef6f20f38dd8d429f56de371b7fe7 100755
--- a/tests/checkout_test.py
+++ b/tests/checkout_test.py
@@ -233,6 +233,15 @@ class BaseTest(fake_repos.FakeReposTestBase):
def _log(self):
raise NotImplementedError()
+ def _test_process(self, co):
+ """Makes sure the process lambda is called correctly."""
+ co.prepare()
+ ps = self.get_patches()
+ results = []
+ co.apply_patch(ps, [lambda *args: results.append(args)])
+ expected = [(co, p) for p in ps.patches]
+ self.assertEquals(expected, results)
+
class SvnBaseTest(BaseTest):
def setUp(self):
@@ -377,6 +386,13 @@ class SvnCheckout(SvnBaseTest):
cwd=co.project_path)
self.assertEquals('LF\n', out)
+ def testProcess(self):
+ co = checkout.SvnCheckout(
+ self.root_dir, self.name,
+ None, None,
+ self.svn_url)
+ self._test_process(co)
+
class GitSvnCheckout(SvnBaseTest):
name = 'foo.git'
@@ -442,6 +458,13 @@ class GitSvnCheckout(SvnBaseTest):
co.apply_patch(
[patch.FilePatchDiff('svn_utils_test.txt', NAKED_PATCH, svn_props)])
+ def testProcess(self):
+ co = checkout.SvnCheckout(
+ self.root_dir, self.name,
+ None, None,
+ self.svn_url)
+ self._test_process(co)
+
class RawCheckout(SvnBaseTest):
def setUp(self):
@@ -502,6 +525,13 @@ class RawCheckout(SvnBaseTest):
'1 out of 1 hunk FAILED -- saving rejects to file '
'svn_utils_test.txt.rej\n')
+ def testProcess(self):
+ co = checkout.SvnCheckout(
+ self.root_dir, self.name,
+ None, None,
+ self.svn_url)
+ self._test_process(co)
+
if __name__ == '__main__':
if '-v' in sys.argv:
« no previous file with comments | « patch.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698