From 24e9396dc547edf62b600621e34737e4a134e53e Mon Sep 17 00:00:00 2001 From: Henrique Lopes Fouquet <102550763+RickFqt@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:04:25 -0300 Subject: [PATCH] Achieve 100% test coverage on Action Space Base (#109) 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