def test_recent_moves_feature(self): f = features.recent_move_feature(TEST_POSITION) self.assertEqual(f.shape, (9, 9, features.recent_move_feature.planes)) # most recent move at (1, 0) self.assertEqual(f[1, 0, 0], 1) self.assertEqual(f[1, 0, 3], 0) # second most recent move at (0, 8) self.assertEqual(f[0, 8, 1], 1) self.assertEqual(f[0, 8, 0], 0) # third most recent move at (0, 1) self.assertEqual(f[0, 1, 2], 1) # no more older moves self.assertEqualNPArray(f[:, :, 3], np.zeros([9, 9])) self.assertEqualNPArray(f[:, :, features.recent_move_feature.planes - 1], np.zeros([9, 9]))