Ejemplo n.º 1
0
def start_microservice(spec_path: str,
                       ns: str = "default",
                       secrets: Secrets = None):
    """
    !!!DEPRECATED!!!
    """
    _log_deprecated("start_microservice", "create_deployment")
    create_deployment(spec_path, ns, secrets)
Ejemplo n.º 2
0
def test_create_deployment(client, api, json, open):
    v1 = MagicMock()
    client.AppsV1beta1Api.return_value = v1
    json.loads.return_value = {"Kind": "Deployment"}

    create_deployment(spec_path="depl.json")

    v1.create_namespaced_deployment.assert_called_with(
        ANY, body=json.loads.return_value)
Ejemplo n.º 3
0
def test_cannot_process_other_than_yaml_and_json(has_conf):
    has_conf.return_value = False
    path = "./tests/fixtures/invalid-k8s.txt"
    with pytest.raises(ActivityFailed) as excinfo:
        create_deployment(spec_path=path)
    assert "cannot process {path}".format(path=path) in str(excinfo)