def test_activate_aliased_registry(test_assets_dir, config): add_registry(URI_1, "mine", config) add_registry(URI_2, "other", config) activate_registry("other", config) store_data = json.loads( (config.xdg_ethpmcli_root / REGISTRY_STORE).read_text()) assert store_data[URI_2]["active"] is True assert store_data[URI_1]["active"] is False
def test_unable_to_activate_nonexistent_aliased_registry(config): add_registry(URI_1, "mine", config) with pytest.raises(InstallError): activate_registry("other", config)
def registry_activate_cmd(args: argparse.Namespace) -> None: config = Config(args) activate_registry(args.uri_or_alias, config) cli_logger.info(f"Registry @ {args.uri_or_alias} activated.")