Skip to content

Commit

Permalink
test_build.py: refactor test_build_init
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Feb 21, 2024
1 parent 53d3e62 commit 1ccc838
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/code_commands/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ def test_build_complete2(clirunner, configenv):


def test_build_init(clirunner, configenv):
"""Test: apio build with apio init"""

with clirunner.isolated_filesystem():

# -- Config the environment (conftest.configenv())
configenv()

# apio init --board icezum
Expand All @@ -264,17 +268,19 @@ def test_build_init(clirunner, configenv):
# apio build --fpga iCE40-HX1K-VQ100
result = clirunner.invoke(cmd_build, ["--fpga", "iCE40-HX1K-VQ100"])
assert result.exit_code != 0
# assert 'Info: ignore apio.ini board' in result.output
assert (
"Error: contradictory arguments: ('iCE40-HX1K-TQ144', 'iCE40-HX1K-VQ100')"
in result.output
)

# apio build --type lp --size 8k --pack cm225:4k
result = clirunner.invoke(
cmd_build, ["--type", "lp", "--size", "8k", "--pack", "cm225:4k"]
)
assert result.exit_code != 0
# assert 'Info: ignore apio.ini board' in result.output
assert "Error: contradictory arguments: ('hx', 'lp')" in result.output

# apio build --type lp --size 8k
result = clirunner.invoke(cmd_build, ["--type", "lp", "--size", "8k"])
assert result.exit_code != 0
# assert 'Info: ignore apio.ini board' in result.output
# assert 'Error: insufficient arguments: missing pack' in result.output
assert "Error: contradictory arguments: ('hx', 'lp')" in result.output

0 comments on commit 1ccc838

Please sign in to comment.