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

Method test_bbox

Lib/test/test_ttk/test_widgets.py:1491–1514  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1489 self.checkInvalidParam(widget, 'titleitems', -2)
1490
1491 def test_bbox(self):
1492 self.tv.pack()
1493 self.assertEqual(self.tv.bbox(''), '')
1494 self.tv.update()
1495
1496 item_id = self.tv.insert('', 'end')
1497 children = self.tv.get_children()
1498 self.assertTrue(children)
1499
1500 bbox = self.tv.bbox(children[0])
1501 self.assertIsBoundingBox(bbox)
1502
1503 # compare width in bboxes
1504 self.tv['columns'] = ['test']
1505 self.tv.column('test', width=50)
1506 bbox_column0 = self.tv.bbox(children[0], 0)
1507 root_width = self.tv.column('#0', width=None)
1508 if not self.wantobjects:
1509 root_width = int(root_width)
1510 self.assertEqual(bbox_column0[0], bbox[0] + root_width)
1511
1512 # verify that bbox of a closed item is the empty string
1513 child1 = self.tv.insert(item_id, 'end')
1514 self.assertEqual(self.tv.bbox(child1), '')
1515
1516 def test_children(self):
1517 # no children yet, should get an empty tuple

Callers

nothing calls this directly

Calls 9

assertTrueMethod · 0.80
assertIsBoundingBoxMethod · 0.80
packMethod · 0.45
assertEqualMethod · 0.45
bboxMethod · 0.45
updateMethod · 0.45
insertMethod · 0.45
get_childrenMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected