def test_pos(self): """ Test the Pos class. """ from enable.layout.geometry import Pos pos = Pos(10, 20) self.assertTrue(pos.x == 10) self.assertTrue(pos.y == 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))