def test_prompt_replicas_auth_server(monkeypatch, settings): from pygluu.kubernetes.terminal.replicas import PromptReplicas monkeypatch.setattr("click.prompt", lambda x, default: 1) settings.set("auth-server.replicas", "") PromptReplicas(settings).prompt_replicas() assert settings.get("auth-server.replicas") == 1
def test_prompt_replicas_auth_server(monkeypatch, settings): from pygluu.kubernetes.terminal.replicas import PromptReplicas monkeypatch.setattr("click.prompt", lambda x, default: 1) # bypass settings.set("OXTRUST_REPLICAS", 1) PromptReplicas(settings).prompt_replicas() assert settings.get("AUTH_SERVER_REPLICAS") == 1
def test_prompt_replicas_casa(monkeypatch, settings): from pygluu.kubernetes.terminal.replicas import PromptReplicas monkeypatch.setattr("click.prompt", lambda x, default: 1) # bypass settings.set("casa.replicas", "") settings.set("config.configmap.cnCasaEnabled", "Y") PromptReplicas(settings).prompt_replicas() assert settings.get("casa.replicas") == 1
def test_prompt_replicas_client_api(monkeypatch, settings): from pygluu.kubernetes.terminal.replicas import PromptReplicas monkeypatch.setattr("click.prompt", lambda x, default: 1) # bypass settings.set("client-api.replicas", "") settings.set("global.client-api.enabled", "Y") PromptReplicas(settings).prompt_replicas() assert settings.get("client-api.replicas") == 1
def test_prompt_replicas_persistence(monkeypatch, settings, type_): from pygluu.kubernetes.terminal.replicas import PromptReplicas monkeypatch.setattr("click.prompt", lambda x, default: 1) # bypass settings.set("opendj.replicas", "") settings.set("global.cnPersistenceType", type_) PromptReplicas(settings).prompt_replicas() assert settings.get("opendj.replicas") == 1
def test_prompt_replicas_client_api(monkeypatch, settings): from pygluu.kubernetes.terminal.replicas import PromptReplicas monkeypatch.setattr("click.prompt", lambda x, default: 1) # bypass settings.set("AUTH_SERVER_REPLICAS", 1) settings.set("OXTRUST_REPLICAS", 1) settings.set("ENABLE_CLIENT_API", "Y") PromptReplicas(settings).prompt_replicas() assert settings.get("CLIENT_API_REPLICAS") == 1
def test_prompt_replicas_oxshibboleth(monkeypatch, settings): from pygluu.kubernetes.terminal.replicas import PromptReplicas monkeypatch.setattr("click.prompt", lambda x, default: 1) # bypass settings.set("AUTH_SERVER_REPLICAS", 1) settings.set("OXTRUST_REPLICAS", 1) settings.set("ENABLE_OXSHIBBOLETH", "Y") PromptReplicas(settings).prompt_replicas() assert settings.get("OXSHIBBOLETH_REPLICAS") == 1
def test_prompt_replicas_persistence(monkeypatch, settings, type_): from pygluu.kubernetes.terminal.replicas import PromptReplicas monkeypatch.setattr("click.prompt", lambda x, default: 1) # bypass settings.set("AUTH_SERVER_REPLICAS", 1) settings.set("OXTRUST_REPLICAS", 1) settings.set("PERSISTENCE_BACKEND", type_) PromptReplicas(settings).prompt_replicas() assert settings.get("LDAP_REPLICAS") == 1
def replicas(self): self.load_settings() replicas = PromptReplicas(self.settings) replicas.prompt_replicas()