Skip to content

Commit

Permalink
refactor test_upgrade.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Feb 24, 2024
1 parent 8031648 commit 7f43b38
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions test/env_commands/test_upgrade.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
"""
Test for the "apio upgrade" command
"""

import pytest

# -- apio upgrade entry point
from apio.commands.upgrade import cli as cmd_upgrade


def test_upgrade(clirunner, validate_cliresult, offline):
def test_upgrade(clirunner, configenv, validate_cliresult, offline):
"""Test "apio upgrade" """

# -- If the option 'offline' is passed, the test is skip
# -- (apio upgrade uses internet)
if offline:
pytest.skip('requires internet connection')

result = clirunner.invoke(cmd_upgrade)
validate_cliresult(result)
with clirunner.isolated_filesystem():

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

# -- Execute "apio upgrade"
result = clirunner.invoke(cmd_upgrade)
validate_cliresult(result)

0 comments on commit 7f43b38

Please sign in to comment.