def test_remove_activate_other(config_mocker, mocker): config = Config() config.load('/tmp') assert config.active.id == 'VA-000' config.remove_account('VA-000') assert config.active.id == 'VA-001'
def test_remove_account(): config = Config() config.add_account( 'VA-000', 'Account 1', 'ApiKey XXXX:YYYY', endpoint='https://my_custom_endpoint', ) assert config.active.id == 'VA-000' assert len(config.accounts) == 1 config.remove_account('VA-000') assert config.active is None assert len(config.accounts) == 0
def test_remove_non_existent_account(): config = Config() with pytest.raises(click.ClickException) as ex: config.remove_account('VA-999') assert ex.value.message == 'The account identified by VA-999 does not exist.'