def test_submit_update_revision_not_found(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(data=[]), dict(phid='PHID-USER-1'), dict(data=[]), dict(data=[]))
    testfile = (git_repo_path / 'X')
    testfile.write_text(u'ą', encoding='utf-8')
    git_out('add', '.')
    msgfile = (git_repo_path / 'msg')
    msgfile.write_text(u'Bug 1 - Ą\n\nDifferential Revision: http://example.test/D123\n', encoding='utf-8')
    git_out('commit', '--file', 'msg')
    testfile.write_text(u'missing repo')
    msgfile.write_text(u'Bug 1 - missing revision\n\nDifferential Revision: http://example.test/D124\n')
    git_out('commit', '--all', '--file', './msg')
    with pytest.raises(exceptions.Error) as excinfo:
        mozphab.main((((['submit', '--yes'] + ['--bug', '1']) + ['--message', 'update message ćwikła']) + [init_sha]), is_development=True)
    assert ('query result for revision D124' in str(excinfo.value))
def test_submit_update_revision_not_found(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(data=[]), dict(phid='PHID-USER-1'), dict(data=[]), dict(data=[]))
    testfile = (git_repo_path / 'X')
    testfile.write_text(u'ą', encoding='utf-8')
    git_out('add', '.')
    msgfile = (git_repo_path / 'msg')
    msgfile.write_text(u'Bug 1 - Ą\n\nDifferential Revision: http://example.test/D123\n', encoding='utf-8')
    git_out('commit', '--file', 'msg')
    testfile.write_text(u'missing repo')
    msgfile.write_text(u'Bug 1 - missing revision\n\nDifferential Revision: http://example.test/D124\n')
    git_out('commit', '--all', '--file', './msg')
    with pytest.raises(exceptions.Error) as excinfo:
        mozphab.main((((['submit', '--yes'] + ['--bug', '1']) + ['--message', 'update message ćwikła']) + [init_sha]), is_development=True)
    assert ('query result for revision D124' in str(excinfo.value))