Skip to content

Commit

Permalink
add unit test for csle-common
Browse files Browse the repository at this point in the history
  • Loading branch information
foroughsh committed Aug 30, 2023
1 parent 590a5f9 commit bab7672
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,20 @@ def test_joint_observation_space_config(self) -> None:
joint_observation_space_config.to_dict())
assert (JointObservationSpaceConfig.from_dict(joint_observation_space_config.to_dict()) ==
joint_observation_space_config)

def test_observation(self) -> None:
"""
Tests creation and dict conversion of the Observation DAO
:return: None
"""

observation = Observation(id=1, val=2, descr="test")

assert isinstance(observation.to_dict(), dict)
assert isinstance(Observation.from_dict(observation.to_dict()),
Observation)
assert (Observation.from_dict(observation.to_dict()).to_dict() ==
observation.to_dict())
assert (Observation.from_dict(observation.to_dict()) ==
observation)

0 comments on commit bab7672

Please sign in to comment.