MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_add

Method test_add

test/base/test_utils.py:1712–1725  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1710 self.assert_eq(ids, [])
1711
1712 def test_add(self):
1713 for type_ in (object, ImmutableSubclass):
1714 data = [type_(), type_()]
1715 ids = util.IdentitySet()
1716 for i in list(range(2)) + list(range(2)):
1717 ids.add(data[i])
1718 self.assert_eq(ids, data)
1719
1720 for type_ in (NoHash, EqOverride, HashOverride, HashEqOverride):
1721 data = [type_(1), type_(1), type_(2)]
1722 ids = util.IdentitySet()
1723 for i in list(range(3)) + list(range(3)):
1724 ids.add(data[i])
1725 self.assert_eq(ids, data)
1726
1727 def test_dunder_sub2(self):
1728 IdentitySet = util.IdentitySet

Callers

nothing calls this directly

Calls 2

addMethod · 0.95
assert_eqMethod · 0.95

Tested by

no test coverage detected