From f01c7fe7b2322a0835846bfbc2d3f8989ee7d8a3 Mon Sep 17 00:00:00 2001 From: RickFqt Date: Fri, 11 Oct 2024 10:49:54 -0300 Subject: [PATCH] test: Added final tests for action space base --- tests/units/actions/test_action_space_base.py | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/units/actions/test_action_space_base.py b/tests/units/actions/test_action_space_base.py index fc0ddc2a..088f403b 100644 --- a/tests/units/actions/test_action_space_base.py +++ b/tests/units/actions/test_action_space_base.py @@ -50,4 +50,28 @@ def test_size(self): fake_action_space.get_actions = MagicMock(return_value=[]) # THEN - self.assertEqual(fake_action_space.size, 0) \ No newline at end of file + self.assertEqual(fake_action_space.size, 0) + + def test_get_actions_id(self): + + # GIVEN + fake_action_space = FakeActionSpace() + + # WHEN + fake_action_space.get_actions = MagicMock(return_value=[]) + + # THEN + self.assertEqual(fake_action_space.get_actions_id(), []) + + def test_get_actions_id_with_actions(self): + + # GIVEN + fake_action_space = FakeActionSpace() + + # WHEN + fake_action_space.get_actions = MagicMock( + return_value=[MagicMock(__id__="action1"), MagicMock(__id__="action2")] + ) + + # THEN + self.assertEqual(fake_action_space.get_actions_id(), ["action1", "action2"]) \ No newline at end of file