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