def test_submit_update_no_message(in_process, git_repo_path, init_sha):
    call_conduit.reset_mock()
    call_conduit.side_effect = (dict(), 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'), dict(dict(phid='PHID-DIFF-1', diffid='1')), dict(), dict(object=dict(id='123')), dict())
    (git_repo_path / 'X').write_text(u'ą', encoding='utf-8')
    git_out('add', '.')
    (git_repo_path / 'msg').write_text(u'Bug 1 - Ą\n\nDifferential Revision: http://example.test/D123\n', encoding='utf-8')
    git_out('commit', '--file', 'msg')
    mozphab.main(['submit', '--yes', '--bug', '1', init_sha], is_development=True)
    log = git_out('log', '--format=%s%n%n%b', '-1')
    expected = 'Bug 1 - Ą\n\nDifferential Revision: http://example.test/D123\n\n'
    assert (log == expected)
def test_submit_update_no_message(in_process, git_repo_path, init_sha):
    call_conduit.reset_mock()
    call_conduit.side_effect = (dict(), 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'), dict(dict(phid='PHID-DIFF-1', diffid='1')), dict(), dict(object=dict(id='123')), dict())
    (git_repo_path / 'X').write_text(u'ą', encoding='utf-8')
    git_out('add', '.')
    (git_repo_path / 'msg').write_text(u'Bug 1 - Ą\n\nDifferential Revision: http://example.test/D123\n', encoding='utf-8')
    git_out('commit', '--file', 'msg')
    mozphab.main(['submit', '--yes', '--bug', '1', init_sha], is_development=True)
    log = git_out('log', '--format=%s%n%n%b', '-1')
    expected = 'Bug 1 - Ą\n\nDifferential Revision: http://example.test/D123\n\n'
    assert (log == expected)