[ILibraryView] child_order shouldn't leak graphlib.CycleErrror
This commit is contained in:
parent
09a95a6608
commit
ae314cce93
2 changed files with 28 additions and 2 deletions
|
|
@ -293,6 +293,26 @@ def test_library_subtree() -> None:
|
|||
assert "c" not in sub
|
||||
|
||||
|
||||
def test_library_child_order_cycle_raises_library_error() -> None:
|
||||
lib = Library()
|
||||
lib["a"] = Pattern()
|
||||
lib["a"].ref("b")
|
||||
lib["b"] = Pattern()
|
||||
lib["b"].ref("a")
|
||||
|
||||
with pytest.raises(LibraryError, match="Cycle found while building child order"):
|
||||
lib.child_order()
|
||||
|
||||
|
||||
def test_library_find_refs_global_cycle_raises_library_error() -> None:
|
||||
lib = Library()
|
||||
lib["a"] = Pattern()
|
||||
lib["a"].ref("a")
|
||||
|
||||
with pytest.raises(LibraryError, match="Cycle found while building child order"):
|
||||
lib.find_refs_global("a")
|
||||
|
||||
|
||||
def test_library_get_name() -> None:
|
||||
lib = Library()
|
||||
lib["cell"] = Pattern()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue