mim/tests/test_list.py
Zaida Zhou 6f309bdd98
[Refactor] Refactor list cmd (#67)
* [Refactor] Refactor list cmd

* simply

* fix errror when getting home-pag from pypi

* fix unittet

* add unittest

* fix ci

* fix ci

* install wheel in CI to fix error

* refactor and add a decorator to make sure package has been installed

* rename function and add commnent for CI
2021-07-24 11:43:31 +08:00

18 lines
493 B
Python

from click.testing import CliRunner
from mim.commands.install import cli as install
from mim.commands.list import list_package
def test_list():
runner = CliRunner()
# mim install mmcls==0.11.0 --yes
result = runner.invoke(install, ['mmcls==0.12.0', '--yes'])
assert result.exit_code == 0
# mim list
target = ('mmcls', '0.12.0',
'https://github.com/open-mmlab/mmclassification')
result = list_package()
print(result)
assert target in result