Skip to content

Commit

Permalink
Merge pull request #278 from Limmen/foro
Browse files Browse the repository at this point in the history
add unit test for csle-common
  • Loading branch information
Limmen authored Aug 29, 2023
2 parents 099382e + aed8fce commit 59ac2d3
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from csle_common.dao.simulation_config.action import Action


class TestSimulationConfigDaoSuite:
"""
Test suite for simulation config data access objects (DAOs)
"""

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

action = Action(id=1, descr="test")

assert isinstance(action.to_dict(), dict)
assert isinstance(Action.from_dict(action.to_dict()),
Action)
assert (Action.from_dict(action.to_dict()).to_dict() ==
action.to_dict())
assert (Action.from_dict(action.to_dict()) ==
action)

0 comments on commit 59ac2d3

Please sign in to comment.