code: def test_env_actions(self):
      # Environment keeps taking actions and not us, we should eventually lose.
      ttt = ttt_env.TicTacToeEnv(strict=True)
      for _ in range(9):
          ttt.play_random_move()
          if ttt.done:
              break
  
      reward, done = ttt_env.get_reward_and_done(ttt.board_state)
      self.assertEqual(-1, reward)
      self.assertTrue(done)
  
file_path: tensor2tensor/tensor2tensor/envs/tic_tac_toe_env_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.envs import tic_tac_toe_env
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the TicTacToeEnvTest obj's underlying member method code with example usage: obj.test_env_actions() without return types