예제 #1
0
 def testRemoveMoreThanCurrent(self):
     state = game1.get_start_state()
     game1.modify_state(state, 'green', 0, 0, 'add_pill', 1)
     with self.assertRaises(Exception):
         game1.modify_state(state, 'green', 0, 0, 'remove_pill', 2)
예제 #2
0
 def testModifyAdd(self):
     state = game1.get_start_state()
     game1.modify_state(state, 'green', 0, 0, 'add_pill', 1)
     self.assertEqual(state.days['green'][0][0], 1)
예제 #3
0
 def testSameState(self):
     state = game1.get_start_state()
     game1.modify_state(state, 'green', 0, 0, 'add_pill', 1)
     game1.modify_state(state, 'green', 0, 0, 'remove_pill', 1)
     self.assertEqual(
         len(pyhop.pyhop(state, [('sort_meds', game1.get_goal())])), 13)