mirror of
https://github.com/KLayout/klayout.git
synced 2026-08-29 09:20:45 +02:00
Fixing issue #1651 (errors when adding polygons with 4 points) - needs some testing
This commit is contained in:
Vendored
+10
@@ -746,6 +746,16 @@ class DBPolygonTests(unittest.TestCase):
|
||||
poly = pya.Polygon(hull).insert_hole(hole1).insert_hole(hole2)
|
||||
self.assertEqual(str(poly), "(0,0;0,3000;6000,3000;6000,0/1000,1000;2000,1000;2000,2000;1000,2000/3000,1000;4000,1000;4000,2000;3000,2000)")
|
||||
|
||||
def test_argumentShortcuts(self):
|
||||
|
||||
# implicit conversion to a Point array:
|
||||
poly = pya.Polygon([ (0,0), (0,1000), (1000,1000) ])
|
||||
self.assertEqual(str(poly), "(0,0;0,1000;1000,1000)")
|
||||
|
||||
# issue 1651 - no binding to Box constructor
|
||||
poly = pya.Polygon([ (0,0), (0,1000), (1000,1000), (1000,0) ])
|
||||
self.assertEqual(str(poly), "(0,0;0,1000;1000,1000;1000,0)")
|
||||
|
||||
# run unit tests
|
||||
if __name__ == '__main__':
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(DBPolygonTests)
|
||||
|
||||
Reference in New Issue
Block a user