diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-10-20 11:29:14 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-10-20 11:29:14 +0200 |
commit | 02978fb1f6ec4874440df237b4b5f7806cc23681 (patch) | |
tree | 307efc6aea237e80e45c18910d4a1663503c5c75 /tests | |
parent | 15510515a5fa98d212082057effb6b002310125e (diff) |
pq: let drop work when pq branch is checked out
Diffstat (limited to 'tests')
-rw-r--r-- | tests/component/rpm/test_pq_rpm.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/component/rpm/test_pq_rpm.py b/tests/component/rpm/test_pq_rpm.py index 15b6d89f..683852d7 100644 --- a/tests/component/rpm/test_pq_rpm.py +++ b/tests/component/rpm/test_pq_rpm.py @@ -165,10 +165,21 @@ class TestPqRpm(RpmRepoTestBase): repo.set_branch('patch-queue/master') branches = repo.get_local_branches() - # Drop pq should fail when on pq branch - eq_(mock_pq(['drop']), 1) - self._check_log(-1, "gbp:error: On a patch-queue branch, can't drop it") - self._check_repo_state(repo, 'patch-queue/master', branches) + # Switch to master + eq_(mock_pq(['switch']), 0) + self._check_repo_state(repo, 'master', branches) + + # Drop should succeed when on master branch + eq_(mock_pq(['drop']), 0) + branches.remove('patch-queue/master') + self._check_repo_state(repo, 'master', branches) + + def test_drop_pq(self): + """drop action should work on pq branch""" + repo = self.init_test_repo('gbp-test') + repo.rename_branch('pq/master', 'patch-queue/master') + repo.set_branch('patch-queue/master') + branches = repo.get_local_branches() # Switch to master eq_(mock_pq(['switch']), 0) |