Skip to content

Commit

Permalink
Bug 1569545 - Added tests for submitting a patch when a user-defined …
Browse files Browse the repository at this point in the history
…bookmark is present

Reviewers: zalun

Reviewed By: zalun

Subscribers: zalun

Bug #: 1569545

Differential Revision: https://phabricator.services.mozilla.com/D39653
  • Loading branch information
sigiesec authored and zalun committed Jul 30, 2019
1 parent 6b31ddb commit 9909549
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/test_integration-hg.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,33 @@ def test_submit_create(in_process, hg_repo_path):
"""
assert log.strip() == expected.strip()

assert hg_out("bookmark").strip() == "no bookmarks set"


def test_submit_create_with_user_bookmark(in_process, hg_repo_path):
call_conduit.reset_mock()
call_conduit.side_effect = ({}, [{"userName": "alice", "phid": "PHID-USER-1"}])

testfile = hg_repo_path / "X"
testfile.write_text(u"a")
hg_out("add")
hg_out("commit", "--message", "A r?alice")

user_bookmark_name = "user_bookmark"
hg_out("bookmark", user_bookmark_name)

mozphab.main(["submit", "--yes", "--bug", "1"])

log = hg_out("log", "--template", r"{desc}\n", "--rev", ".")
expected = """
Bug 1 - A r?alice
Differential Revision: http://example.test/D123
"""
assert log.strip() == expected.strip()

assert hg_out("bookmark").startswith(" * " + user_bookmark_name)


def test_submit_update(in_process, hg_repo_path):
call_conduit.reset_mock()
Expand Down

0 comments on commit 9909549

Please sign in to comment.