예제 #1
0
def test_deployment_is_fully_available_when_it_should_not(
        cl, client, watch, has_conf):
    has_conf.return_value = False
    deployment = MagicMock()
    deployment.spec.replicas = 2
    deployment.status.ready_replicas = 2

    watcher = MagicMock()
    watcher.stream = MagicMock()
    watcher.stream.side_effect = urllib3.exceptions.ReadTimeoutError(
        None, None, None)
    watch.Watch.return_value = watcher

    with pytest.raises(ActivityFailed) as excinfo:
        deployment_not_fully_available("mysvc")
    assert "deployment 'mysvc' failed to stop running within" in str(excinfo)
예제 #2
0
def deployment_is_not_fully_available(name: str,
                                      ns: str = "default",
                                      label_selector: str = None,
                                      timeout: int = 30,
                                      secrets: Secrets = None):
    """
    !!!DEPRECATED!!!
    """
    _log_deprecated("deployment_is_not_fully_available",
                    "deployment_not_fully_available")
    return deployment_not_fully_available(name, ns, label_selector, timeout,
                                          secrets)