def test_submit_create_no_bug(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(userName='alice', phid='PHID-USER-1')], dict(dict(phid='PHID-DIFF-1', diffid='1')), dict(), dict(object=dict(id='123')), dict())
    testfile = (git_repo_path / 'X')
    testfile.write_text('a\n')
    git_out('add', '.')
    msgfile = (git_repo_path / 'msg')
    msgfile.write_text('A r?alice')
    git_out('commit', '--file', 'msg')
    mozphab.main(['submit', '--yes', '--no-bug', init_sha], is_development=True)
    log = git_out('log', '--format=%s%n%n%b', '-1')
    expected = '\nA r?alice\n\nDifferential Revision: http://example.test/D123\n'
    assert (log.strip() == expected.strip())
def test_submit_create_no_bug(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(userName='alice', phid='PHID-USER-1')], dict(dict(phid='PHID-DIFF-1', diffid='1')), dict(), dict(object=dict(id='123')), dict())
    testfile = (git_repo_path / 'X')
    testfile.write_text('a\n')
    git_out('add', '.')
    msgfile = (git_repo_path / 'msg')
    msgfile.write_text('A r?alice')
    git_out('commit', '--file', 'msg')
    mozphab.main(['submit', '--yes', '--no-bug', init_sha], is_development=True)
    log = git_out('log', '--format=%s%n%n%b', '-1')
    expected = '\nA r?alice\n\nDifferential Revision: http://example.test/D123\n'
    assert (log.strip() == expected.strip())