def test_invariant_scale_shrink(self): big_square = PointShape([Point(2, 2), Point(2, 4), Point(4, 4), Point(4, 2)]) small_square = PointShape([Point(1, 1), Point(1, 2), Point(2, 2), Point(2, 1)]) big_square.invariant_scale(0.5) self.assertEqual(big_square, small_square)
def test_invariant_scale_grow(self): small_square = PointShape([Point(1, 1), Point(1, 2), Point(2, 2), Point(2, 1)]) small_square.invariant_scale(2) scaled_square = PointShape([Point(2, 2), Point(2, 4), Point(4, 4), Point(4, 2)]) self.assertEqual(scaled_square, small_square)