'A copy of test_get_liberties_after but where captures are imminent'

def test_get_liberties_after_cap(self):

    gs = capture_board()
    pp = Preprocess(['liberties_after'])
    feature = pp.state_to_tensor(gs)[0].transpose((1, 2, 0))
    one_hot_liberties = np.zeros((gs.size, gs.size, 8))
    for (x, y) in gs.get_legal_moves():
        copy = gs.copy()
        copy.do_move((x, y))
        libs = copy.liberty_counts[(x, y)]
        one_hot_liberties[(x, y, min((libs - 1), 7))] = 1
    for i in range(8):
        self.assertTrue(np.all((feature[:, :, i] == one_hot_liberties[:, :, i])), ('bad    expectation:    stones    with    %d    liberties    after    move' % (i + 1)))
