Skip to content

Commit

Permalink
Achieve 100% test coverage on Action Space Base (#109)
Browse files Browse the repository at this point in the history
test: Added final tests for action space base
  • Loading branch information
RickFqt authored Oct 18, 2024
1 parent a3a1f6b commit 24e9396
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion tests/units/actions/test_action_space_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,28 @@ def test_size(self):
fake_action_space.get_actions = MagicMock(return_value=[])

# THEN
self.assertEqual(fake_action_space.size, 0)
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"])

0 comments on commit 24e9396

Please sign in to comment.