MCPcopy Index your code
hub / github.com/python/cpython / test_moveto

Method test_moveto

Lib/test/test_tkinter/test_widgets.py:1019–1039  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1017
1018 @requires_tk(8, 6)
1019 def test_moveto(self):
1020 widget = self.create()
1021 i1 = widget.create_rectangle(1, 1, 20, 20, tags='group')
1022 i2 = widget.create_rectangle(30, 30, 50, 70, tags='group')
1023 x1, y1, _, _ = widget.bbox(i1)
1024 x2, y2, _, _ = widget.bbox(i2)
1025 widget.moveto('group', 200, 100)
1026 x1_2, y1_2, _, _ = widget.bbox(i1)
1027 x2_2, y2_2, _, _ = widget.bbox(i2)
1028 self.assertEqual(x1_2, 200)
1029 self.assertEqual(y1_2, 100)
1030 self.assertEqual(x2 - x1, x2_2 - x1_2)
1031 self.assertEqual(y2 - y1, y2_2 - y1_2)
1032 widget.tag_lower(i2, i1)
1033 widget.moveto('group', y=50)
1034 x1_3, y1_3, _, _ = widget.bbox(i1)
1035 x2_3, y2_3, _, _ = widget.bbox(i2)
1036 self.assertEqual(y2_3, 50)
1037 self.assertEqual(x2_3, x2_2)
1038 self.assertEqual(x2_2 - x1_2, x2_3 - x1_3)
1039 self.assertEqual(y2_2 - y1_2, y2_3 - y1_3)
1040
1041
1042@add_configure_tests(IntegerSizeTests, StandardOptionsTests)

Callers

nothing calls this directly

Calls 6

createMethod · 0.95
create_rectangleMethod · 0.80
movetoMethod · 0.80
bboxMethod · 0.45
assertEqualMethod · 0.45
tag_lowerMethod · 0.45

Tested by

no test coverage detected