1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
pip/tests/functional/test_vcs_bazaar.py
2021-04-03 15:44:00 +02:00

32 lines
754 B
Python

"""
Contains functional tests of the Bazaar class.
"""
import os
import pytest
from pip._internal.vcs.bazaar import Bazaar
from pip._internal.vcs.versioncontrol import RemoteNotFoundError
from tests.lib import is_bzr_installed, need_bzr
@pytest.mark.skipif(
'TRAVIS' not in os.environ,
reason='Bazaar is only required under Travis')
def test_ensure_bzr_available():
"""Make sure that bzr is available when running in Travis."""
assert is_bzr_installed()
@need_bzr
def test_get_remote_url__no_remote(script, tmpdir):
repo_dir = tmpdir / 'temp-repo'
repo_dir.mkdir()
repo_dir = str(repo_dir)
script.run('bzr', 'init', repo_dir)
with pytest.raises(RemoteNotFoundError):
Bazaar().get_remote_url(repo_dir)