Exemple #1
0
 def test_decode_zero_one_one(self):
     symbols = decode([Brick(0), Brick(1), Brick(1)])
     self.assertEqual(symbols, r"\||")
Exemple #2
0
 def test_decode_two_one_one(self):
     symbols = decode([Brick(2), Brick(1), Brick(1)])
     self.assertEqual(symbols, r"/||")
Exemple #3
0
 def test_brick_previous_state_both_falling_different_directions(self):
     brick = Brick(1, 2, 0)
     brick.previous_state()
     self.assertEqual(brick.state, 1)
Exemple #4
0
 def test_decode_all_ones(self):
     symbols = decode([Brick(1), Brick(1), Brick(1)])
     self.assertEqual(symbols, r"|||")
Exemple #5
0
 def test_brick_create(self):
     brick = Brick(1, 2, 0)
     self.assertEqual(brick.state, 1)
     self.assertEqual(brick.previous, 2)
     self.assertEqual(brick.next, 0)
Exemple #6
0
 def test_brick_previous_state_none_falling(self):
     brick = Brick(1, 1, 1)
     brick.previous_state()
     self.assertEqual(brick.state, 1)
Exemple #7
0
 def test_brick_previous_state_falling_left(self):
     brick = Brick(0, 1, 0)
     brick.previous_state()
     self.assertEqual(brick.state, 1)
Exemple #8
0
 def test_brick_previous_state_falling_right(self):
     brick = Brick(2, 2, 1)
     brick.previous_state()
     self.assertEqual(brick.state, 1)
Exemple #9
0
 def test_brick_previous_state_all_falling_left(self):
     brick = Brick(2, 2, 2)
     brick.previous_state()
     self.assertEqual(brick.state, 2)
Exemple #10
0
 def test_brick_previous_state_all_falling_right(self):
     brick = Brick(0, 0, 0)
     brick.previous_state()
     self.assertEqual(brick.state, 0)
Exemple #11
0
 def test_brick_next_state_both_falling(self):
     brick = Brick(1, 2, 0)
     brick.next_state()
     self.assertEqual(brick.state, 1)
Exemple #12
0
 def test_brick_next_state_right_falling(self):
     brick = Brick(1, 1, 0)
     brick.next_state()
     self.assertEqual(brick.state, 0)
Exemple #13
0
 def test_brick_next_state_left_falling(self):
     brick = Brick(1, 2, 1)
     brick.next_state()
     self.assertEqual(brick.state, 2)
Exemple #14
0
 def test_brick_next_state_none_falling(self):
     brick = Brick(1, 1, 1)
     brick.next_state()
     self.assertEqual(brick.state, 1)
Exemple #15
0
 def test_decode_two_zero_two(self):
     symbols = decode([Brick(2), Brick(0), Brick(2)])
     self.assertEqual(symbols, r"/\/")