def test_submit_update_arc(in_process, git_repo_path, init_sha):
    call_conduit.reset_mock()
    call_conduit.side_effect = ({}, dict(data=[dict(phid='PHID-REPO-1', fields=dict(vcs='git'))]), dict(data=[search_rev(rev=123)]), dict(data=[search_diff()]), dict(phid='PHID-USER-1'))
    testfile = (git_repo_path / 'X')
    testfile.write_text('a')
    git_out('add', '.')
    git_out('commit', '--message', 'Bug 1 - A\n\nDifferential Revision: http://example.test/D123\n')
    mozphab.main((((['submit', '--arc', '--yes'] + ['--bug', '1']) + ['--message', 'update message ćwikła']) + [init_sha]), is_development=True)
    log = git_out('log', '--format=%s%n%n%b', '-1')
    expected = 'Bug 1 - A\n\nDifferential Revision: http://example.test/D123\n\n'
    assert (log == expected)
def test_submit_update_arc(in_process, git_repo_path, init_sha):
    call_conduit.reset_mock()
    call_conduit.side_effect = ({}, dict(data=[dict(phid='PHID-REPO-1', fields=dict(vcs='git'))]), dict(data=[search_rev(rev=123)]), dict(data=[search_diff()]), dict(phid='PHID-USER-1'))
    testfile = (git_repo_path / 'X')
    testfile.write_text('a')
    git_out('add', '.')
    git_out('commit', '--message', 'Bug 1 - A\n\nDifferential Revision: http://example.test/D123\n')
    mozphab.main((((['submit', '--arc', '--yes'] + ['--bug', '1']) + ['--message', 'update message ćwikła']) + [init_sha]), is_development=True)
    log = git_out('log', '--format=%s%n%n%b', '-1')
    expected = 'Bug 1 - A\n\nDifferential Revision: http://example.test/D123\n\n'
    assert (log == expected)