forked from FPGAwars/apio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_drivers.py
32 lines (25 loc) · 931 Bytes
/
test_drivers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Test for the "apio drivers" command
"""
from test.conftest import ApioRunner
# -- apio drivers entry point
from apio.commands.drivers import cli as apio_drivers
def test_drivers(apio_runner: ApioRunner):
"""Test "apio drivers" """
with apio_runner.in_sandbox() as sb:
# -- Execute "apio drivers"
result = sb.invoke_apio_cmd(apio_drivers)
assert result.exit_code == 1
assert (
"specify one of --ftdi-install, --ftdi-uninstall, "
"--serial-install, or --serial-uninstall" in result.output
)
# -- Execute "apio --ftdi-install, --serial-install"
result = sb.invoke_apio_cmd(
apio_drivers, ["--ftdi-install", "--serial-install"]
)
assert result.exit_code == 1, result.output
assert (
"Error: --ftdi-install and --serial-install cannot be combined"
in result.output
)