def test_touch_border(self): print("GeometryTest.test_touch_border") hierarchy = super().basic_hierarchy() domain_box = hierarchy.domain_box self.assertFalse(touch_domain_border(Box2D(10, 14), domain_box, "upper")) self.assertFalse(touch_domain_border(Box2D(10, 14), domain_box, "lower")) self.assertTrue(touch_domain_border(Box2D(0, 14), domain_box, "lower")) self.assertTrue(touch_domain_border(Box2D(-5, 14), domain_box, "lower")) self.assertTrue(touch_domain_border(Box2D(-5, 10), domain_box, "lower")) self.assertTrue(touch_domain_border(Box2D(-5, 30), domain_box, "upper")) self.assertTrue(touch_domain_border(Box2D(10, 30), domain_box, "upper")) self.assertTrue(touch_domain_border(Box2D(10, 24), domain_box, "upper"))
def test_touch_border(self): hierarchy = self.basic_hierarchy() self.assertFalse( touch_domain_border(Box(10, 20), hierarchy.domain_box, "upper") ) self.assertFalse( touch_domain_border(Box(10, 20), hierarchy.domain_box, "lower") ) self.assertTrue(touch_domain_border(Box(0, 20), hierarchy.domain_box, "lower")) self.assertTrue(touch_domain_border(Box(-5, 20), hierarchy.domain_box, "lower")) self.assertTrue(touch_domain_border(Box(-5, 70), hierarchy.domain_box, "lower")) self.assertTrue(touch_domain_border(Box(-5, 70), hierarchy.domain_box, "upper")) self.assertTrue(touch_domain_border(Box(40, 70), hierarchy.domain_box, "upper")) self.assertTrue(touch_domain_border(Box(40, 64), hierarchy.domain_box, "upper"))