def test_size(self): """ Test the Size class. """ from enable.layout.geometry import Size size = Size(40, 20) self.assertTrue(size == Size((40, 20))) self.assertTrue(size.width == 40) self.assertTrue(size.height == 20)
def test_box(self): """ Test the Box class. """ from enable.layout.geometry import Rect, Box, Pos, Size box = Box(20, 70, 60, 10) self.assertTrue(box == Box((20, 70, 60, 10))) self.assertTrue(box.rect == Rect(10, 20, 60, 40)) self.assertTrue(box.pos == Pos(10, 20)) self.assertTrue(box.size == Size(60, 40))
def test_rect(self): """ Test the Rect class. """ from enable.layout.geometry import Rect, Box, Pos, Size rect = Rect(10, 20, 60, 40) self.assertTrue(rect.box == Box(20, 70, 60, 10)) self.assertTrue(rect.pos == Pos(10, 20)) self.assertTrue(rect.size == Size(60, 40))