def test_step_back(self): game = Game() state, _ = game.init_game() init_hand = state['state'][0] game.step('hit') game.step_back() test_hand = game.get_state(0)['state'][0] self.assertEqual(init_hand, test_hand) self.assertEqual(len(game.history), 0)
def test_step_back(self): game = Game(allow_step_back=True) game.configure(DEFAULT_GAME_CONFIG) state, _ = game.init_game() init_hand = state['state'][0] game.step('hit') game.step_back() test_hand = game.get_state(0)['state'][0] self.assertEqual(init_hand, test_hand) self.assertEqual(len(game.history), 0) success = game.step_back() self.assertEqual(success, False)