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

Unified Diff: tests/git_common_test.py

Issue 311243003: Make git-freeze bail out if the user has too much untracked data. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Unnecessary genexp Created 6 years, 6 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
« git_common.py ('K') | « man/src/git-freeze.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/git_common_test.py
diff --git a/tests/git_common_test.py b/tests/git_common_test.py
index bba5b43ff8b163a2f4b725a82e8ad02631b219ce..e001e7b5ce8ada3c05c5381fa9abd548f8c753db 100755
--- a/tests/git_common_test.py
+++ b/tests/git_common_test.py
@@ -577,6 +577,23 @@ class GitMutableStructuredTest(git_test_utils.GitRepoReadWriteTestBase,
CAT DOG
""")
+ def testStatus(self):
+ def inner():
+ dictified_status = lambda: {
+ k: dict(v._asdict()) # pylint: disable=W0212
+ for k, v in self.repo.run(self.gc.status).iteritems()
+ }
+ self.repo.git('mv', 'file', 'cat')
+ with open('COOL', 'w') as f:
+ f.write('Super cool file!')
+ self.assertDictEqual(
+ dictified_status(),
+ {'cat': {'lstat': 'R', 'rstat': ' ', 'src': 'file'},
+ 'COOL': {'lstat': '?', 'rstat': '?', 'src': 'COOL'}}
+ )
+
+ self.repo.run(inner)
+
class GitFreezeThaw(git_test_utils.GitRepoReadWriteTestBase):
@classmethod
@@ -655,6 +672,18 @@ class GitFreezeThaw(git_test_utils.GitRepoReadWriteTestBase):
self.repo.run(inner)
+ def testTooBig(self):
+ def inner():
+ self.repo.git('config', 'depot-tools.freeze-size-limit', '1')
+ with open('bigfile', 'w') as f:
+ chunk = 'NERDFACE' * 1024
+ for _ in xrange(128 * 2 + 1): # Just over 2 mb
+ f.write(chunk)
+ _, err = self.repo.capture_stdio(self.gc.freeze)
+ self.assertIn('too much untracked+unignored', err)
+
+ self.repo.run(inner)
+
if __name__ == '__main__':
sys.exit(coverage_utils.covered_main(
« git_common.py ('K') | « man/src/git-freeze.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698