def test_stack_tall(self): bottom = Shape('#...:#...:....:....') top = Shape('#...:#...:....:....') merged = bottom.stack(top) assert merged == '#...:#...:#...:#...'
def test_diagonal(self): bottom = Shape('...#:....:....:....') top = Shape('.#..:....:....:....') merged = bottom.stack(top) assert merged == '.#.#:....:....:....'
def test_stack_full_layers(self): bottom = Shape('####:....:....:....') top = Shape('####:....:....:....') merged = bottom.stack(top) assert merged == '####:####:....:....'
def test_no_empty_shape(self): empty = Shape('....:....:....:....') with pytest.raises(ValueError): empty.stack(empty)
def test_simple_merge(self): bottom = Shape('##..:....:....:....') top = Shape('..##:....:....:....') merged = bottom.stack(top) assert merged == '####:....:....:....'
def test_tetris(self): bottom = Shape('.##.:..#.:..#.:....') top = Shape('.#..:.##.:....:....') merged = bottom.stack(top) assert merged == '.##.:..#.:.##.:.##.'
def test_logo(self): left_half = Shape('...#:..#.:....:....') right_half = Shape('##..:....:....:....') logo = left_half.stack(right_half) assert logo == '##.#:..#.:....:....'
def test_trim_to_four_layers(self): bottom = Shape('#...:#...:...#:....') top = Shape('####:...#:....:....') merged = bottom.stack(top) assert merged == '#...:#...:...#:####'
def test_long_drop(self): bottom = Shape('#...:#...:#...:#...') top = Shape('.#..:....:....:....') merged = bottom.stack(top) assert merged == '##..:#...:#...:#...'
def test_staircase(self): bottom = Shape('#..#:##..:....:....') top = Shape('.##.:..##:....:....') merged = bottom.stack(top) assert merged == '#..#:##..:.##.:..##'
def test_stack_merge_on_second_layer(self): bottom = Shape('##..:#...:....:....') top = Shape('.##.:....:....:....') merged = bottom.stack(top) assert merged == '##..:###.:....:....'
def test_stack_angle(self): bottom = Shape('##..:....:....:....') top = Shape('.##.:....:....:....') merged = bottom.stack(top) assert merged == '##..:.##.:....:....'