def test_submit_single_last(in_process, git_repo_path, init_sha):
    call_conduit.side_effect = (dict(), dict(data=[dict(phid='PHID-REPO-1', fields=dict(vcs='git'))]), dict(dict(phid='PHID-DIFF-1', diffid='1')), dict(), dict(object=dict(id='123')), dict())
    (git_repo_path / 'X').write_text('a\n')
    git_out('add', 'X')
    git_out('commit', '-am', 'A')
    (git_repo_path / 'X').write_text('b\n')
    git_out('commit', '-am', 'B')
    mozphab.main(['submit', '--yes', '--bug', '1', '--single'], is_development=True)
    log = git_out('log', '--format=%s%n%n%b', '-2')
    expected = 'Bug 1 - B\n\nDifferential Revision: http://example.test/D123\nA\n\n\n'
    assert (log == expected)
def test_submit_single_last(in_process, git_repo_path, init_sha):
    call_conduit.side_effect = (dict(), dict(data=[dict(phid='PHID-REPO-1', fields=dict(vcs='git'))]), dict(dict(phid='PHID-DIFF-1', diffid='1')), dict(), dict(object=dict(id='123')), dict())
    (git_repo_path / 'X').write_text('a\n')
    git_out('add', 'X')
    git_out('commit', '-am', 'A')
    (git_repo_path / 'X').write_text('b\n')
    git_out('commit', '-am', 'B')
    mozphab.main(['submit', '--yes', '--bug', '1', '--single'], is_development=True)
    log = git_out('log', '--format=%s%n%n%b', '-2')
    expected = 'Bug 1 - B\n\nDifferential Revision: http://example.test/D123\nA\n\n\n'
    assert (log == expected)