[ILibrary.add] respect mutate_other=False even without duplicate keys
This commit is contained in:
parent
9767ee4e62
commit
f461222852
2 changed files with 18 additions and 2 deletions
|
|
@ -221,6 +221,17 @@ def test_library_rename() -> None:
|
|||
assert "old" not in lib["parent"].refs
|
||||
|
||||
|
||||
def test_library_add_no_duplicates_respects_mutate_other_false() -> None:
|
||||
src_pat = Pattern(ports={"A": Port((0, 0), 0)})
|
||||
lib = Library({"a": Pattern()})
|
||||
|
||||
lib.add({"b": src_pat}, mutate_other=False)
|
||||
|
||||
assert lib["b"] is not src_pat
|
||||
lib["b"].ports["A"].offset[0] = 123
|
||||
assert tuple(src_pat.ports["A"].offset) == (0.0, 0.0)
|
||||
|
||||
|
||||
def test_library_subtree() -> None:
|
||||
lib = Library()
|
||||
lib["a"] = Pattern()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue