Skip to content

Commit

Permalink
refactor test_time.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Feb 23, 2024
1 parent 1a26ea4 commit 523d4e0
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions test/code_commands/test_time.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
"""
Test for the "apio time" command
"""

# -- apio time entry point
from apio.commands.time import cli as cmd_time


def test_time(clirunner, configenv):
"""Test: apio time
when no apio.ini file is given
No additional parameters are given
"""

with clirunner.isolated_filesystem():

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

# -- Execute "apio time"
result = clirunner.invoke(cmd_time)

# -- Check the result
assert result.exit_code != 0
assert 'Info: No apio.ini file' in result.output
#assert 'Error: insufficient arguments: missing board' in result.output
assert 'Error: insufficient arguments: missing board' in result.output


def test_time_board(clirunner, configenv):
"""Test: apio time
when parameters are given
"""

with clirunner.isolated_filesystem():

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

# -- Execute "apio time"
result = clirunner.invoke(cmd_time, ['--board', 'icezum'])

# -- Check the result
assert result.exit_code != 0
#if result.exit_code == 1:
# assert 'apio install oss-cad-suite' in result.output
assert 'apio install oss-cad-suite' in result.output

0 comments on commit 523d4e0

Please sign in to comment.