Example #1
0
def test_remove_aliased_registry(test_assets_dir, config):
    add_registry(URI_1, "mine", config)
    add_registry(URI_2, "other", config)
    remove_registry("other", config)
    expected_registry_store = json.loads(
        (test_assets_dir / "registry_store" / "init.json").read_text())
    actual_registry_store = json.loads(
        (config.xdg_ethpmcli_root / REGISTRY_STORE).read_text())
    assert actual_registry_store == expected_registry_store
Example #2
0
def test_remove_active_registry_raises_error(config):
    add_registry(URI_1, "mine", config)
    with pytest.raises(InstallError):
        remove_registry(URI_2, config)
Example #3
0
def test_remove_nonexisting_aliased_registry_raises_exception(config):
    add_registry(URI_1, "mine", config)
    with pytest.raises(InstallError):
        remove_registry("other", config)
Example #4
0
def test_remove_registry_with_nonexisting_store(config):
    with pytest.raises(InstallError, match="Unable to remove registry"):
        remove_registry(URI_2, config)
Example #5
0
def registry_remove_cmd(args: argparse.Namespace) -> None:
    config = Config(args)
    remove_registry(args.uri_or_alias, config)
    cli_logger.info(
        f"Registry: {args.uri_or_alias} removed from registry store.")