def test_squares_should_be_equal_with_same_coords_different_state(self): square_a = Square(x=5, y=2) square_b = Square(x=5, y=2) square_b.flip() self.assertTrue(square_a == square_b, "Squares with equal coordinates should be equal even " "with different activated states")
def test_squares_should_be_equal_with_same_coords_different_state(self): square_a = Square(x=5, y=2) square_b = Square(x=5, y=2) square_b.flip() self.assertTrue( square_a == square_b, "Squares with equal coordinates should be equal even " "with different activated states")
def test_square_hash_does_not_reflect_activation(self): square_a = Square(x=2, y=3) square_b = Square(x=2, y=3) square_b.flip() self.assertEqual(hash(square_a), hash(square_b))
def test_square_flipping_twice_leaves_same_activated_property(self): square = Square(x=0, y=0) square.flip() square.flip() self.assertEqual(False, square.activated)
def test_square_flip_function_flips_activated_property(self): square = Square(x=0, y=0) square.flip() self.assertEqual(True, square.activated)