mirror of
https://github.com/KLayout/klayout.git
synced 2026-08-29 01:14:35 +02:00
Merge pull request #2015 from KLayout/bugfix/issue-2012
Bugfix/issue 2012
This commit is contained in:
Vendored
+1
-1
@@ -684,7 +684,7 @@ class DBLayoutTest(unittest.TestCase):
|
||||
ly = pya.Layout(True)
|
||||
pv = [ [ 17, "a" ], [ "b", [ 1, 5, 7 ] ] ]
|
||||
pid = ly.properties_id( pv )
|
||||
# does not work? @@@
|
||||
# does not work?
|
||||
# pv = { 17: "a", "b": [ 1, 5, 7 ] }
|
||||
# pid2 = ly.properties_id( pv )
|
||||
# self.assertEqual( pid, pid2 )
|
||||
|
||||
Vendored
+13
-1
@@ -24,7 +24,7 @@ import os
|
||||
class DBShapesTest(unittest.TestCase):
|
||||
|
||||
# Shape objects as hashes
|
||||
def test_12(self):
|
||||
def test_1(self):
|
||||
|
||||
s = pya.Shapes()
|
||||
s1 = s.insert(pya.Box(1, 2, 3, 4))
|
||||
@@ -50,6 +50,18 @@ class DBShapesTest(unittest.TestCase):
|
||||
self.assertEqual(h[s2], 2)
|
||||
self.assertEqual(h[s3], 3)
|
||||
|
||||
# Issue #2012 (reference count)
|
||||
def test_2(self):
|
||||
|
||||
ly = pya.Layout()
|
||||
top = ly.create_cell("TOP")
|
||||
l1 = ly.layer(1, 0)
|
||||
top.shapes(l1).insert(pya.Box(0, 0, 100, 200))
|
||||
|
||||
shapes = top.shapes(l1)
|
||||
self.assertEqual(sys.getrefcount(shapes), 2)
|
||||
|
||||
|
||||
# run unit tests
|
||||
if __name__ == '__main__':
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(DBShapesTest)
|
||||
|
||||
Reference in New Issue
Block a user