-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #278 from Limmen/foro
add unit test for csle-common
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
simulation-system/libs/csle-common/tests/test_simulation_config_dao.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |