def test_2(self): p = db.DSimplePolygon(db.DBox(1, 2, 3, 4)) a = bridge.p2a(p) pp = bridge.a2p(a) self.assertEqual(str(pp), "(1,2;1,4;3,4;3,2)") self.assertEqual(type(pp).__name__, "DSimplePolygon")
def test_1(self): p = db.DSimplePolygon(db.DBox(1, 2, 3, 4)) a = bridge.p2a(p) self.assertEqual(repr(bridge.p2a(p)), "[(1.0, 2.0), (1.0, 4.0), (3.0, 4.0), (3.0, 2.0)]")