Skip to content

Commit

Permalink
fix and test
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyAJohnston committed Jan 13, 2025
1 parent 8ef5ae8 commit 339b624
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions databpy/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ def create_collection(
if parent is None:
return coll
parent.children.link(coll)
bpy.context.scene.collection.children.unlink(coll)
return coll
5 changes: 5 additions & 0 deletions tests/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ def test_collection():
assert coll.name == "Example"
assert coll.name in bpy.data.collections
assert coll.name in bpy.data.collections["Collection"].children


def test_collection_parent():
db.collection.create_collection(".MN_data", parent="MolecularNodes")
assert ".MN_data" not in bpy.context.scene.collection.children
4 changes: 1 addition & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 339b624

Please sign in to comment.