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)
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)
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)