-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,42 +1,45 @@ | |||
import mock | import mock | ||
import os | import os | ||
import sys | |||
|
|
||
import git_sphinx_build | import git_sphinx_build | ||
import git_sphinx_build.virtualenv as venv | import git_sphinx_build.virtualenv as venv | ||
|
|
||
|
|
||
# def test_virtualenv_download_path(): | def test_virtualenv_from_git(testdirectory): | ||
|
|
||
# assert venv.default_download_path() != "" | git = mock.Mock() | ||
log = mock.Mock() | |||
clone_path = testdirectory.path() | |||
|
|
||
virtualenv = venv.VirtualEnv.from_git( | |||
git=git, clone_path=clone_path, log=log) | |||
|
|
||
# def test_virtualenv_download(testdirectory): | # The following directory should be in the PYTHONPATH of the virtualenv | ||
# prompt | |||
virtualenv_path = os.path.join(clone_path, venv.VERSION) | |||
|
|
||
# venv.download(download_path=testdirectory.path()) | assert virtualenv.prompt.env['PYTHONPATH'] == virtualenv_path | ||
|
|
||
|
|
||
# def test_virtualenv_create(testdirectory): | def test_virtualenv(testdirectory): | ||
|
|
||
# # Set a download dir, it should not exist otherwise the test | prompt = mock.Mock() | ||
# # will not download one | log = mock.Mock() | ||
# download_path = os.path.join(testdirectory.path(), 'download') | path = os.path.join(testdirectory.path(), 'venv') | ||
|
|
||
# # venv.download(download_path=download_path) | virtualenv = venv.VirtualEnv(prompt=prompt, log=log) | ||
|
|
||
# # Create an environment where the virtualenv is available | env = virtualenv.create_environment(path=path) | ||
# #runner_environment = venv.environment(download_path=download_path) | |||
|
|
||
# #virtualenv_root = testdirectory.mkdir('virtualenv_root') | prompt.run.assert_called_once_with( | ||
command=['python', '-m', 'virtualenv', path, '--no-site-packages']) | |||
|
|
||
# # clone_dir = testdirectory.mkdir('clone') | # Depending on our platform the path should be modified | ||
# # create_dir = testdirectory.mkdir('create') | if sys.platform == 'win32': | ||
expected_path = os.path.join(path, 'Scripts') | |||
else: | |||
expected_path = os.path.join(path, 'bin') | |||
|
|
||
# # path = VirtualEnv.download(download_path=clone_dir.path()) | # We should be first in the PATH environment variable | ||
|
assert env['PATH'].startswith(expected_path) | ||
# # env = dict(os.environ) | |||
# # env.update({'PYTHONPATH': path}) | |||
|
|||
# # venv = VirtualEnv.create(cwd=testdirectory.path(), env=env) | |||
|
|||
# # venv.pip_install(packages=['sphinx']) | |||
# # venv.run('sphinx-build --help') |