Skip to content

Commit

Permalink
apio install: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Mar 13, 2024
1 parent ef48f74 commit 848a7e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 5 additions & 3 deletions apio/managers/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,11 @@ def install(self):
# -- In case of any other error, try to install with the other
# -- url...
# --- ummm very likely this second installation can be removed...
except Exception:
# Try os name
dlpath = self._install_os_package(platform_download_url)
# except Exception:
# Try os name
# dlpath = self._install_os_package(platform_download_url)
except util.ApioException:
click.secho("Error: Package not found\n", fg="red")

# -- Second step: Install downloaded package
self._install_package(dlpath)
Expand Down
9 changes: 4 additions & 5 deletions test/packages/test_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,17 @@ def test_complete(clirunner, validate_cliresult, configenv, offline):
# -- Config the environment (conftest.configenv())
configenv()

# -- Execute "apio examples"
# -- Execute "apio uninstall examples"
result = clirunner.invoke(
cmd_uninstall, ['examples'], input='y')
assert 'Do you want to continue?' in result.output
assert 'Error: package \'examples\' is not installed' in result.output

# -- Execute "apio examples@X"
# -- Execute "apio install examples@X"
result = clirunner.invoke(cmd_install, ['examples@X'])
assert 'Error: package not availabe' in result.output
assert 'for this platform' in result.output
assert 'Error: Package not found' in result.output

# -- Execute "apio examples@0.0.34"
# -- Execute "apio install examples@0.0.34"
result = clirunner.invoke(cmd_install, ['examples@0.0.34'])
validate_cliresult(result)
assert 'Installing examples package' in result.output
Expand Down

0 comments on commit 848a7e4

Please sign in to comment.