Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_steady_probe_needs_a_name():
step = {
"probes": {
"steady": {
}
}
}
with pytest.raises(InvalidPlan) as excinfo:
apply_steady_probe(step, layers)
assert "steady probe requires a probe name to apply" in str(excinfo)
def test_steady_probe_must_be_implemented():
step = {
"probes": {
"steady": {
"layer": "noop",
"name": "microservice-should-be-happy"
}
}
}
with pytest.raises(UnknownProbe) as excinfo:
apply_steady_probe(step, layers)
assert "probe 'microservice_should_be_happy' is not implemented" in\
str(excinfo)
def test_a_step_without_steady_probe_is_silent():
step = {}
assert apply_steady_probe(step, layers) is None