Skip to content

Commit

Permalink
apply style
Browse files Browse the repository at this point in the history
  • Loading branch information
francescofuggitti committed Oct 9, 2023
1 parent 92b0113 commit ec33589
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
4 changes: 1 addition & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
TRIANGLE_FILES = FIXTURES_PDDL_FILES / "triangle-tireworld"
BLOCKSWORLD_FOND_FILES = FIXTURES_PDDL_FILES / "blocksworld_fond"

DOMAIN_FILES = [
*FIXTURES_PDDL_FILES.glob("./**/domain.pddl")
]
DOMAIN_FILES = [*FIXTURES_PDDL_FILES.glob("./**/domain.pddl")]

DOMAIN_NAMES = [
"acrobatics",
Expand Down
27 changes: 12 additions & 15 deletions tests/test_function_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
# https://opensource.org/licenses/MIT.
#
"""This module contains tests for PDDL function operators."""
from pddl.parser.symbols import Symbols

from pddl.logic import variables
from pddl.logic.functions import Function, FunctionOperator
from pddl.parser.symbols import Symbols


class TestFunctionOperators:
Expand All @@ -23,12 +22,8 @@ def setup_method(self):
"""Set up the tests."""
x, y = variables("x y", types=["type1"])
z = variables("z", types=["type2"])
self.function = Function("function_1")
self.function_op = FunctionOperator(
self.function,
3,
Symbols.EQUAL
)
self.function = Function("function_1", x, y, z)
self.function_op = FunctionOperator(self.function, 3, Symbols.EQUAL)

def test_function(self):
"""Test the function getter."""
Expand All @@ -44,17 +39,19 @@ def test_value(self):

def test_equal(self):
"""Test the equal operator."""
other = FunctionOperator(
self.function,
3,
Symbols.EQUAL.value
)
other = FunctionOperator(self.function, 3, Symbols.EQUAL.value)
assert self.function_op == other

def test_str(self):
"""Test the str operator."""
assert str(self.function_op) == f"({self.function_op.symbol.value} {self.function} {self.function_op.value})"
assert (
str(self.function_op)
== f"({self.function_op.symbol.value} {self.function} {self.function_op.value})"
)

def test_repr(self):
"""Test the repr operator."""
assert repr(self.function_op) == f"FunctionOperator({self.function}, {self.function_op.value})"
assert (
repr(self.function_op)
== f"FunctionOperator({self.function}, {self.function_op.value})"
)

0 comments on commit ec33589

Please sign in to comment.