def test_add_status_module(): @status.module("{dummy}") def dummy_method(): return "dummy" assert status.evaluate("Dummy: {dummy}") == "Dummy: dummy" del status._modules["{dummy}"] # Cleanup
def test_log_unknown_module(mocker): mocker.patch.object(status, "_log_unknown_module") assert status.evaluate("Dummy: {unknown}") == "Dummy: " assert status._log_unknown_module.call_count == 1
def test_evaluate_unknown_module(): name = "{unknown-module}" assert status.evaluate(f"Dummy: {name}") == "Dummy: "
def test_evaluate_status_module(dummy_module): name, content = dummy_module assert status.evaluate(f"Dummy: {name}") == f"Dummy: {content}"