mirror of
https://github.com/open-mmlab/mim.git
synced 2025-06-03 14:59:11 +08:00
* [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
29 lines
958 B
Python
29 lines
958 B
Python
from click.testing import CliRunner
|
|
|
|
from mim.commands.install import cli as install
|
|
from mim.commands.uninstall import cli as uninstall
|
|
from mim.utils import get_github_url, parse_home_page
|
|
|
|
|
|
def test_parse_home_page():
|
|
runner = CliRunner()
|
|
result = runner.invoke(install, ['mmcls', '--yes'])
|
|
assert result.exit_code == 0
|
|
assert parse_home_page(
|
|
'mmcls') == 'https://github.com/open-mmlab/mmclassification'
|
|
result = runner.invoke(uninstall, ['mmcls', '--yes'])
|
|
assert result.exit_code == 0
|
|
|
|
|
|
def test_get_github_url():
|
|
runner = CliRunner()
|
|
result = runner.invoke(install, ['mmcls', '--yes'])
|
|
assert result.exit_code == 0
|
|
assert get_github_url(
|
|
'mmcls') == 'https://github.com/open-mmlab/mmclassification.git'
|
|
|
|
result = runner.invoke(uninstall, ['mmcls', '--yes'])
|
|
assert result.exit_code == 0
|
|
assert get_github_url(
|
|
'mmcls') == 'https://github.com/open-mmlab/mmclassification.git'
|