Skip to content

Commit b3fc373

Browse files
authored
Merge pull request #135 from AI-Planning/extra-constants-tests
Extra constants tests
2 parents 68a6ce7 + c7800f9 commit b3fc373

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

pddl/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
__title__ = "pddl"
1616
__description__ = "PDDL parser"
1717
__url__ = "https://github.com/AI-Planning/pddl.git"
18-
__version__ = "0.4.2"
18+
__version__ = "0.4.3"
1919
__author__ = "Marco Favorito, Francesco Fuggitti, Christian Muise"
2020
__author_email__ = (
2121
"marco.favorito@gmail.com, francesco.fuggitti@gmail.com, christian.muise@queensu.ca"

tests/test_functions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import pytest
1515

1616
from pddl.logic.functions import Metric, NumericFunction, NumericValue
17-
from pddl.logic.helpers import variables
17+
from pddl.logic.helpers import constants, variables
1818
from pddl.parser.symbols import Symbols
1919

2020

@@ -24,7 +24,9 @@ class TestNumericFunction:
2424
def setup_method(self):
2525
"""Set up the tests."""
2626
self.a, self.b = variables("a b", types=["type1"])
27+
self.c = constants("c")[0]
2728
self.function = NumericFunction("func", self.a, self.b)
29+
self.function2 = NumericFunction("func2", self.a, self.c)
2830

2931
def test_name(self):
3032
"""Test name getter."""
@@ -46,6 +48,7 @@ def test_to_equal(self):
4648
def test_to_str(self):
4749
"""Test to string."""
4850
assert str(self.function) == f"({self.function.name} {self.a} {self.b})"
51+
assert str(self.function2) == f"({self.function2.name} {self.a} {self.c})"
4952

5053
def test_to_repr(self):
5154
"""Test to repr."""

tests/test_predicate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"""This module contains tests for PDDL predicates."""
1414
from pddl.core import Predicate
1515
from pddl.logic.base import And
16-
from pddl.logic.helpers import variables
16+
from pddl.logic.helpers import constants, variables
1717
from pddl.logic.predicates import DerivedPredicate, EqualTo
1818

1919

@@ -23,7 +23,9 @@ class TestPredicateSimpleInitialisation:
2323
def setup_method(self):
2424
"""Set up the tests."""
2525
self.a, self.b = variables("a b")
26+
self.c = constants("c")[0]
2627
self.predicate = Predicate("P", self.a, self.b)
28+
self.predicate2 = Predicate("P2", self.a, self.c)
2729

2830
def test_name(self):
2931
"""Test name getter."""
@@ -45,6 +47,7 @@ def test_to_equal(self):
4547
def test_to_str(self):
4648
"""Test to string."""
4749
assert str(self.predicate) == f"({self.predicate.name} {self.a} {self.b})"
50+
assert str(self.predicate2) == f"({self.predicate2.name} {self.a} {self.c})"
4851

4952
def test_to_repr(self):
5053
"""Test to repr."""

0 commit comments

Comments
 (0)