def test_move_center(self): """C-5A. Verify moving center Point of Circle works.""" expected = ((6, 2), 1.5) point = Point(2, 3) circle = Circle(point, 1.5) point.x = 6 point.y = 2 self.assertEqual(circle_data(circle), expected)
def test_magnitude_changes(self): """P-6. Verify magnitude property changes after Point changed.""" expected = 5 point = Point(-1, 6) point.x, point.y = 3, 4 self.assertEqual(point.magnitude, expected)
def test_point_modification(self): """P-3. Verify modification of x, y works.""" expected = (-1, 5) point = Point() point.x, point.y = -1, 5 self.assertEqual(point_data(point), expected)
from shapes import Point p1 = Point(2, 3, 'left') print(p1.x) # 2 print(p1.y) # 3 print(p1.name) # left p1.x = 7 # 7 print(p1.x) p1.color = 'blue' print(p1.color) # blue p1.x = 'infinity' # infinity print(p1.x)
from shapes import Point p1 = Point(4, 5) print(p1.x) # 4 print(p1.y) # 5 p1.x = 23 p1.y = 17 print(p1.x) # 23 print(p1.y) # 17