From d5555e69aaa938108124f01fba75f294169bd7b4 Mon Sep 17 00:00:00 2001 From: Ross Allen Date: Mon, 1 Jul 2024 15:09:30 -0700 Subject: [PATCH] adding test for KSPDGBaseAgent logger --- .../test_serverless_base_agent.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/serverless_tests/test_serverless_base_agent.py diff --git a/tests/serverless_tests/test_serverless_base_agent.py b/tests/serverless_tests/test_serverless_base_agent.py new file mode 100644 index 0000000..85aa925 --- /dev/null +++ b/tests/serverless_tests/test_serverless_base_agent.py @@ -0,0 +1,26 @@ +# Copyright (c) 2024, MASSACHUSETTS INSTITUTE OF TECHNOLOGY +# Subject to FAR 52.227-11 – Patent Rights – Ownership by the Contractor (May 2014). +# SPDX-License-Identifier: MIT + +from kspdg.agent_api.base_agent import KSPDGBaseAgent + +class FooAgent(KSPDGBaseAgent): + def __init__(self, debug: bool = False): + # super().__init__(logger_name=FooAgent.__name__, debug=debug) + super().__init__(debug=debug) + def get_action(self, observation): + return None + +def test_KSPDGBaseAgent_logger_0(): + """check logger is created and set to debug without error""" + + # ~~ ARRANGE ~~ + + foo_agent = FooAgent(debug=True) + + # ~~ ACT ~~ + foo_agent.logger.warning("this is a warning statement") + foo_agent.logger.info("this is an info statement") + foo_agent.logger.debug("this is a debug statement") + + # ~~ ASSERT ~~~ \ No newline at end of file