fix: tests were a mess and didn't properly test the functionality but random things that worked with implementation
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful

This commit is contained in:
2024-05-21 13:52:20 +02:00
parent 356ba658ce
commit 8cdb5c1f99
3 changed files with 66 additions and 94 deletions

View File

@@ -115,7 +115,6 @@ class Collection(Generic[T]):
self._data.append(other)
other._inner._is_in_collection.add(self)
"""
for attribute, a in self.sync_on_append.items():
# syncing two collections by reference
b = other.__getattribute__(attribute)
@@ -134,7 +133,6 @@ class Collection(Generic[T]):
a._collection_for[synced_with] = key
a.extend(b_data, **kwargs)
"""
# all of the existing hooks to get the defined datastructures
for collection_attribute, generator in self.extend_object_to_attribute.items():
@@ -162,24 +160,6 @@ class Collection(Generic[T]):
object_trace(f"Appending {other.option_string} to {self}")
for attribute, a in self.sync_on_append.items():
# syncing two collections by reference
b = other.__getattribute__(attribute)
if a is b:
continue
object_trace(f"Syncing [{a}] = [{b}]")
b_data = b.data.copy()
b_collection_for = b._collection_for.copy()
del b
for synced_with, key in b_collection_for.items():
synced_with.__setattr__(key, a)
a._collection_for[synced_with] = key
a.extend(b_data, **kwargs)
# switching collection in the case of push to
for c in self.push_to: