Ejemplo n.º 1
0
 def test_stack_tall(self):
     bottom = Shape('#...:#...:....:....')
     top = Shape('#...:#...:....:....')
     merged = bottom.stack(top)
     assert merged == '#...:#...:#...:#...'
Ejemplo n.º 2
0
 def test_diagonal(self):
     bottom = Shape('...#:....:....:....')
     top = Shape('.#..:....:....:....')
     merged = bottom.stack(top)
     assert merged == '.#.#:....:....:....'
Ejemplo n.º 3
0
 def test_stack_full_layers(self):
     bottom = Shape('####:....:....:....')
     top = Shape('####:....:....:....')
     merged = bottom.stack(top)
     assert merged == '####:####:....:....'
Ejemplo n.º 4
0
 def test_no_empty_shape(self):
     empty = Shape('....:....:....:....')
     with pytest.raises(ValueError):
         empty.stack(empty)
Ejemplo n.º 5
0
 def test_simple_merge(self):
     bottom = Shape('##..:....:....:....')
     top = Shape('..##:....:....:....')
     merged = bottom.stack(top)
     assert merged == '####:....:....:....'
Ejemplo n.º 6
0
 def test_tetris(self):
     bottom = Shape('.##.:..#.:..#.:....')
     top = Shape('.#..:.##.:....:....')
     merged = bottom.stack(top)
     assert merged == '.##.:..#.:.##.:.##.'
Ejemplo n.º 7
0
 def test_logo(self):
     left_half = Shape('...#:..#.:....:....')
     right_half = Shape('##..:....:....:....')
     logo = left_half.stack(right_half)
     assert logo == '##.#:..#.:....:....'
Ejemplo n.º 8
0
 def test_trim_to_four_layers(self):
     bottom = Shape('#...:#...:...#:....')
     top = Shape('####:...#:....:....')
     merged = bottom.stack(top)
     assert merged == '#...:#...:...#:####'
Ejemplo n.º 9
0
 def test_long_drop(self):
     bottom = Shape('#...:#...:#...:#...')
     top = Shape('.#..:....:....:....')
     merged = bottom.stack(top)
     assert merged == '##..:#...:#...:#...'
Ejemplo n.º 10
0
 def test_staircase(self):
     bottom = Shape('#..#:##..:....:....')
     top = Shape('.##.:..##:....:....')
     merged = bottom.stack(top)
     assert merged == '#..#:##..:.##.:..##'
Ejemplo n.º 11
0
 def test_stack_merge_on_second_layer(self):
     bottom = Shape('##..:#...:....:....')
     top = Shape('.##.:....:....:....')
     merged = bottom.stack(top)
     assert merged == '##..:###.:....:....'
Ejemplo n.º 12
0
 def test_stack_angle(self):
     bottom = Shape('##..:....:....:....')
     top = Shape('.##.:....:....:....')
     merged = bottom.stack(top)
     assert merged == '##..:.##.:....:....'