This repository has been archived by the owner on Jan 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #328 from 515hikaru/feature/fix-typo
Fix typo
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# built-in | ||
import json | ||
import sys | ||
from pathlib import Path | ||
|
||
# external | ||
import pytest | ||
from dephell_venvs import VEnv | ||
|
||
# project | ||
from dephell.commands import DepsAuditCommand | ||
from dephell.config import Config | ||
|
||
|
||
@pytest.mark.allow_hosts() | ||
def test_deps_audit_command(temp_path: Path, capsys): | ||
reqs_path = temp_path / 'requirements.txt' | ||
reqs_path.write_text('six==1.12.0') | ||
|
||
venv_path = temp_path / 'venv' | ||
venv = VEnv(path=venv_path) | ||
assert venv.exists() is False | ||
venv.create(python_path=sys.executable) | ||
|
||
config = Config() | ||
config.attach({ | ||
'level': 'WARNING', | ||
'silent': True, | ||
'nocolors': True, | ||
}) | ||
|
||
command = DepsAuditCommand(argv=['jinja2==2.0'], config=config) | ||
result = command() | ||
|
||
captured = capsys.readouterr() | ||
print(captured.err) | ||
print(captured.out) | ||
assert result is False | ||
output = json.loads(captured.out) | ||
assert len(output) >= 2 | ||
for entry in output: | ||
assert entry['current'] == '2.0' | ||
assert entry['name'] == 'jinja2' |