Skip to content

Commit

Permalink
test: add tests on deepcopying of domains and problems
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofavorito committed Jun 6, 2023
1 parent b318d3f commit 532b3e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#

"""This module contains tests for a PDDL domain."""
import copy
import pickle # nosec
import re

Expand All @@ -34,6 +35,13 @@ def test_pickle_domain(domain_obj: Domain) -> None:
assert domain_obj == actual_domain_obj


@pytest.mark.parametrize("domain_obj", pddl_objects_domains)
def test_deepcopy_domain(domain_obj: Domain) -> None:
"""Test that domain objects can be deepcopied correctly."""
new_domain_obj = copy.deepcopy(domain_obj)
assert domain_obj == new_domain_obj


class TestDomainEmpty:
"""Test the empty domain."""

Expand Down
8 changes: 8 additions & 0 deletions tests/test_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#

"""This module contains tests for a PDDL problem."""
import copy
import pickle # nosec
from unittest.mock import MagicMock

Expand All @@ -31,6 +32,13 @@ def test_pickle_problem(problem_obj: Problem) -> None:
assert problem_obj == actual_problem_obj


@pytest.mark.parametrize("problem_obj", pddl_objects_problems)
def test_deepcopy_problem(problem_obj: Problem) -> None:
"""Test that problem objects can be deepcopied correctly."""
new_problem_obj = copy.deepcopy(problem_obj)
assert problem_obj == new_problem_obj


class TestProblemEmpty:
"""Test the empty problem."""

Expand Down

0 comments on commit 532b3e0

Please sign in to comment.