Index: tests/git_common_test.py |
diff --git a/tests/git_common_test.py b/tests/git_common_test.py |
index d4c7dcde952c951a6e6090be5fb38591d0d537aa..8e223c53d34fb647314cdf18928c705ef17f15b0 100755 |
--- a/tests/git_common_test.py |
+++ b/tests/git_common_test.py |
@@ -731,6 +731,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) |
+ } |
+ 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 |
@@ -809,6 +826,39 @@ 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: |
tandrii(chromium)
2016/06/21 14:43:37
3 files, 400KB each, please :)
agable
2016/06/22 11:16:51
Added another test case, which fails without respo
tandrii(chromium)
2016/06/22 14:20:50
Acknowledged.
|
+ 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) |
+ |
+ def testMerge(self): |
+ def inner(): |
+ self.repo.git('checkout', '-b', 'bad_merge_branch') |
+ with open('bad_merge', 'w') as f: |
+ f.write('bad_merge_left') |
+ self.repo.git('add', 'bad_merge') |
+ self.repo.git('commit', '-m', 'bad_merge') |
+ |
+ self.repo.git('checkout', 'branch_D') |
+ with open('bad_merge', 'w') as f: |
+ f.write('bad_merge_right') |
+ self.repo.git('add', 'bad_merge') |
+ self.repo.git('commit', '-m', 'bad_merge_d') |
+ |
+ self.repo.git('merge', 'bad_merge_branch') |
+ |
+ _, err = self.repo.capture_stdio(self.gc.freeze) |
+ self.assertIn('Cannot freeze unmerged changes', err) |
+ |
+ self.repo.run(inner) |
+ |
class GitMakeWorkdir(git_test_utils.GitRepoReadOnlyTestBase, GitCommonTestBase): |
def setUp(self): |