def test_submit_create_arc(in_process, git_repo_path, init_sha):
    call_conduit.side_effect = (dict(), dict(data=[dict(phid='PHID-REPO-1', fields=dict(vcs='git'))]), [{'userName': 'alice', 'phid': 'PHID-USER-1'}])
    testfile = (git_repo_path / 'X')
    testfile.write_text('a')
    git_out('add', '.')
    git_out('commit', '--message', 'A r?alice')
    testfile = (git_repo_path / 'untracked')
    testfile.write_text('a')
    mozphab.main(['submit', '--arc', '--yes', '--bug', '1', init_sha], is_development=True)
    log = git_out('log', '--format=%s%n%n%b', '-1')
    expected = '\nBug 1 - A r?alice\n\nDifferential Revision: http://example.test/D123\n'
    assert (log.strip() == expected.strip())
def test_submit_create_arc(in_process, git_repo_path, init_sha):
    call_conduit.side_effect = (dict(), dict(data=[dict(phid='PHID-REPO-1', fields=dict(vcs='git'))]), [{'userName': 'alice', 'phid': 'PHID-USER-1'}])
    testfile = (git_repo_path / 'X')
    testfile.write_text('a')
    git_out('add', '.')
    git_out('commit', '--message', 'A r?alice')
    testfile = (git_repo_path / 'untracked')
    testfile.write_text('a')
    mozphab.main(['submit', '--arc', '--yes', '--bug', '1', init_sha], is_development=True)
    log = git_out('log', '--format=%s%n%n%b', '-1')
    expected = '\nBug 1 - A r?alice\n\nDifferential Revision: http://example.test/D123\n'
    assert (log.strip() == expected.strip())