Chromium Code Reviews| Index: tests/git_cl_test.py |
| diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py |
| index 82a404ccc4abed4d5f96257abafd405d6eeec24c..18f597760d56bea2d85894782f3aae0bcf09325e 100755 |
| --- a/tests/git_cl_test.py |
| +++ b/tests/git_cl_test.py |
| @@ -1396,7 +1396,7 @@ class TestGitCl(TestCase): |
| ] |
| # TODO(tandrii): consider testing just set-commit and set-commit --clear, |
| # but without copy-pasting tons of expectations, as modifying them later is |
| - # super tedious. |
| +#super tedious. |
| self.assertEqual(0, git_cl.main(['set-commit', '-d'])) |
| def test_description_display(self): |
| @@ -1454,6 +1454,36 @@ class TestGitCl(TestCase): |
| self.assertEqual(0, git_cl.main(['description', '-n', '-'])) |
| self.assertEqual('hi\n\t there\n\nman', ChangelistMock.desc) |
| + def test_cleanup(self): |
| + self.calls = \ |
| + [((['git', 'for-each-ref', '--format=%(refname)', 'refs/heads'],), |
| + 'refs/heads/master\nrefs/heads/foo'), |
| + ((['git', 'config', 'branch.master.rietveldissue'],), '1'), |
| + ((['git', 'config', 'rietveld.autoupdate'],), ''), |
| + ((['git', 'config', 'rietveld.server'],), ''), |
| + ((['git', 'config', 'rietveld.server'],), ''), |
| + ((['git', 'config', 'branch.foo.rietveldissue'],), '456'), |
|
tandrii(chromium)
2016/05/31 18:46:16
can you change this call to return '' instead of 4
Kevin M
2016/05/31 20:05:21
Done for a new branch "bar".
|
| + ((['git', 'config', 'rietveld.server'],), ''), |
| + ((['git', 'config', 'rietveld.server'],), ''), |
| + ((['git', 'tag', 'submitted-foo-456', 'foo'],), ''), |
| + ((['git', 'branch', '-D', 'foo'],), '')] |
| + |
| + class MockChangelist(): |
| + def __init__(self, branch, issue): |
| + self.branch = branch |
| + self.issue = issue |
| + def GetBranch(self): |
| + return self.branch |
| + def GetIssue(self): |
| + return self.issue |
| + |
| + self.mock(git_cl, 'get_cl_statuses', |
| + lambda branches, fine_grained, max_processes: |
| + [(MockChangelist('master', 1), 'open'), |
| + (MockChangelist('foo', 456), 'closed')]) |
| + |
| + git_cl.main(['cleanup', '-f']) |
|
tandrii(chromium)
2016/05/31 18:46:16
assert this returns 0.
Kevin M
2016/05/31 20:05:21
Done.
|
| + |
| if __name__ == '__main__': |
| git_cl.logging.basicConfig( |