def test_neighbouring_blocks(): block_size = (4,4) test_blocks = [\ ([(0, 0), (0, 1), (5, 0), (5, 1)], True),\ ([(0, 0), (0, 5), (5, 0), (5, 1)], False),\ ([(0, 0), (3, 2), (5, 5), (5, 1)], False),\ ([(2, 2), (3, 2), (2, 6), (3, 6)], True),\ ([(1, 1), (2, 2), (6, 6), (7, 7)], False) ] for p, gt in test_blocks: res = gen_code.all_points_in_two_neighbouring_blocks(p, block_size) assert res == gt
def test_neighbouring_blocks(): block_size = (4,4) test_blocks = [\ ([(0, 0), (0, 1), (5, 0), (5, 1)], True),\ ([(0, 0), (0, 5), (5, 0), (5, 1)], False),\ ([(0, 0), (3, 2), (5, 5), (5, 1)], False),\ ([(2, 2), (3, 2), (2, 6), (3, 6)], True),\ ([(1, 1), (2, 2), (6, 6), (7, 7)], False) ] for p, gt in test_blocks: res = gen_code.all_points_in_two_neighbouring_blocks(p, block_size) if res != gt: print p, gt, 'failed' print 'res was', res assert False