forked from python/pymanager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_commands.py
More file actions
24 lines (20 loc) · 788 Bytes
/
test_commands.py
File metadata and controls
24 lines (20 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pytest
import secrets
from manage import commands
def test_help_with_error_command(assert_log, monkeypatch):
expect = secrets.token_hex(16)
cmd = commands.HelpWithErrorCommand(
[commands.HelpWithErrorCommand.CMD, expect, "-v", "-q"],
None
)
monkeypatch.setattr(commands, "EXE_NAME", "pymanager-test")
monkeypatch.setattr(commands, "WELCOME", "")
cmd.execute()
assert_log(
assert_log.skip_until(rf".*Unknown command: pymanager-test {expect} -v -q.*"),
r"Python installation manager \d+\.\d+.*",
assert_log.skip_until(rf"The command .*?pymanager-test {expect} -v -q.*"),
)
def test_exec_with_literal_default():
cmd = commands.load_default_config(None)
assert cmd.get_install_to_run("default", None)