Skip to content

Commit 99dc2a0

Browse files
committed
fix test
1 parent 4bea1ef commit 99dc2a0

4 files changed

Lines changed: 39 additions & 45 deletions

File tree

tests/test_automated_planner.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,41 @@ def test_state_assertion():
4444
"pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl"
4545
)
4646
assert not apla.satisfies(apla.problem.goal, apla.initial_state)
47+
48+
def test_bfs():
49+
apla = AutomatedPlanner(
50+
"pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl"
51+
)
52+
path, _, _ = apla.breadth_first_search()
53+
plan = apla.get_actions_from_path(path)
54+
plan_state = apla.get_state_def_from_path(path)
55+
assert plan and plan_state
56+
57+
def test_dfs():
58+
apla = AutomatedPlanner(
59+
"pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl"
60+
)
61+
path, _, _ = apla.depth_first_search()
62+
plan = apla.get_actions_from_path(path)
63+
plan_state = apla.get_state_def_from_path(path)
64+
assert plan and plan_state
65+
66+
def test_dij():
67+
apla = AutomatedPlanner(
68+
"pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl"
69+
)
70+
path, _, _ = apla.dijktra_best_first_search()
71+
plan = apla.get_actions_from_path(path)
72+
plan_state = apla.get_state_def_from_path(path)
73+
assert plan and plan_state
74+
75+
76+
def test_astar():
77+
apla = AutomatedPlanner(
78+
"pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl"
79+
)
80+
path, _, _ = apla.astar_best_first_search()
81+
plan = apla.get_actions_from_path(path)
82+
plan_state = apla.get_state_def_from_path(path)
83+
assert plan and plan_state
84+

tests/test_basic_search.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -87,27 +87,4 @@ def test_search_astar_basic_no_path():
8787

8888
def test_zero_heuristic():
8989
assert zero_heuristic() == 0
90-
91-
92-
def test_search_getter_costs():
93-
apla = AutomatedPlanner(
94-
"pddl-examples/tsp/domain.pddl", "pddl-examples/tsp/problem.pddl"
95-
)
96-
bfs = BreadthFirstSearch(apla)
97-
path, _, _ = bfs.search() # Path, computation time, opened nodes
98-
plan = apla.get_actions_from_path(path)
99-
state_plan = apla.get_state_def_from_path(path)
100-
101-
assert path and plan and state_plan
102-
103-
104-
def test_search_getter_no_costs():
105-
apla = AutomatedPlanner(
106-
"pddl-examples/cargo/domain.pddl", "pddl-examples/cargo/problem.pddl"
107-
)
108-
bfs = BreadthFirstSearch(apla)
109-
path, _, _ = bfs.search() # Path, computation time, opened nodes
110-
plan = apla.get_actions_from_path(path)
111-
state_plan = apla.get_state_def_from_path(path)
112-
113-
assert path and plan and state_plan
90+

tests/test_setup.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/test_temp.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)