From c3be396950cb03c4675d1ee3b391cb08d7ac4601 Mon Sep 17 00:00:00 2001 From: Jon Bergland Date: Mon, 8 Apr 2024 18:36:13 +0200 Subject: [PATCH] fix: add import for random agent --- src/agents/test_agent_factory.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/agents/test_agent_factory.py diff --git a/src/agents/test_agent_factory.py b/src/agents/test_agent_factory.py new file mode 100644 index 0000000..9b1e901 --- /dev/null +++ b/src/agents/test_agent_factory.py @@ -0,0 +1,13 @@ +from agents.agent_factory import create_agent +from agents.randomAgent import RandomAgent + +def test_create_agent_random(): + agent = create_agent('random') + assert isinstance(agent, RandomAgent) + +def test_create_agent_unknown(): + try: + create_agent('unknown') + assert False, "Expected ValueError" + except ValueError as e: + assert str(e) == "Unknown agent type: unknown" \ No newline at end of file