fix: tests were a mess and didn't properly test the functionality but random things that worked with implementation
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user