From db38e5d4e27e4ad640e8c854613aa1ccac5a76bc Mon Sep 17 00:00:00 2001 From: Angira Sharma Date: Sat, 1 Apr 2017 20:14:00 +0530 Subject: [PATCH] added another test for air_cargo_problem --- tests/test_planning.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/test_planning.py b/tests/test_planning.py index 461cdcdbb..0368eb64f 100644 --- a/tests/test_planning.py +++ b/tests/test_planning.py @@ -18,17 +18,33 @@ def test_action(): assert not a.check_precond(test_kb, args) -def test_air_cargo(): +def test_air_cargo_1(): p = air_cargo() assert p.goal_test() is False - solution = [expr("Load(C1 , P1, SFO)"), + solution_1 = [expr("Load(C1 , P1, SFO)"), expr("Fly(P1, SFO, JFK)"), expr("Unload(C1, P1, JFK)"), expr("Load(C2, P2, JFK)"), expr("Fly(P2, JFK, SFO)"), - expr("Unload (C2, P2, SFO)")] + expr("Unload (C2, P2, SFO)")] - for action in solution: + for action in solution_1: + p.act(action) + + assert p.goal_test() + + +def test_air_cargo_2(): + p = air_cargo() + assert p.goal_test() is False + solution_2 = [expr("Load(C2, P2, JFK)"), + expr("Fly(P2, JFK, SFO)"), + expr("Unload (C2, P2, SFO)"), + expr("Load(C1 , P1, SFO)"), + expr("Fly(P1, SFO, JFK)"), + expr("Unload(C1, P1, JFK)")] + + for action in solution_2: p.act(action) assert p.goal_test()