def test_apply_operator_preconds_satisfied(self): current = ['have baseball', 'arm up', 'have food'] expected = [ 'arm down', 'baseball in air', 'have food', 'throwing baseball' ] goal = 'baseball in air' final = gps.apply_operator(throw, current, ops, goal, []) self.assertEqual(set(final), set(expected))
def test_apply_operator_recurse(self): current = ['hand empty', 'arm down', 'have food'] expected = [ 'arm down', 'baseball in air', 'have food', 'grabbing baseball', 'raising arm', 'throwing baseball' ] goal = 'baseball in air' final = gps.apply_operator(throw, current, ops, goal, []) self.assertEqual(set(final), set(expected))
def test_apply_operator_preconds_satisfied(self): current = ['have baseball', 'arm up', 'have food'] expected = ['arm down', 'baseball in air', 'have food', 'throwing baseball'] goal = 'baseball in air' final = gps.apply_operator(throw, current, ops, goal, []) self.assertEqual(set(final), set(expected))
def test_apply_operator_recurse(self): current = ['hand empty', 'arm down', 'have food'] expected = ['arm down', 'baseball in air', 'have food', 'grabbing baseball', 'raising arm', 'throwing baseball'] goal = 'baseball in air' final = gps.apply_operator(throw, current, ops, goal, []) self.assertEqual(set(final), set(expected))
def test_apply_operator_recurse_fail(self): current = ['hand empty', 'have food', 'arm up'] goal = 'baseball in air' self.assertFalse(gps.apply_operator(throw, current, ops, goal, []))