def setUp(self): self.maxDiff = None self.node = TestNode() self.node.layout = Box(self.node) # Mark the layout as "in calculation" self.node.layout.dirty = None
def __init__(self, name=None, style=None, children=None): self.name = name if name else 'div' self.parent = None self.children = [] if children: for child in children: self.children.append(child) child.parent = self self.intrinsic = Size(self) self.layout = Box(self) self.style = style.copy(self) if style else CSS()
def setUp(self): self.maxDiff = None self.node = TestNode() self.node.layout = Box(self.node) self.node.layout.content_width = 10 self.node.layout.content_height = 16 self.child1 = TestNode() self.child1.layout.content_width = 10 self.child1.layout.content_height = 16 self.child2 = TestNode() self.grandchild1_1 = TestNode() self.grandchild1_1.layout.content_width = 10 self.grandchild1_1.layout.content_height = 16 self.grandchild1_2 = TestNode() self.node.children = [self.child1, self.child2] self.child1.children = [self.grandchild1_1, self.grandchild1_2]