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_close_probe_needs_a_name():
step = {
"probes": {
"close": {
}
}
}
with pytest.raises(InvalidPlan) as excinfo:
apply_close_probe(step, layers)
assert "close probe requires a probe name to apply" in str(excinfo)
def test_close_probe_must_be_implemented():
step = {
"probes": {
"close": {
"layer": "noop",
"name": "microservice-should-be-happy"
}
}
}
with pytest.raises(UnknownProbe) as excinfo:
apply_close_probe(step, layers)
assert "probe 'microservice_should_be_happy' is not implemented" in\
str(excinfo)
def test_a_step_without_close_probe_is_silent():
step = {}
assert apply_close_probe(step, layers) is None