MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_add

Method test_add

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

Source from the content-addressed store, hash-verified

1615 self.assert_eq(ids, [])
1616
1617 def test_add(self):
1618 for type_ in (object, ImmutableSubclass):
1619 data = [type_(), type_()]
1620 ids = util.IdentitySet()
1621 for i in list(range(2)) + list(range(2)):
1622 ids.add(data[i])
1623 self.assert_eq(ids, data)
1624
1625 for type_ in (NoHash, EqOverride, HashOverride, HashEqOverride):
1626 data = [type_(1), type_(1), type_(2)]
1627 ids = util.IdentitySet()
1628 for i in list(range(3)) + list(range(3)):
1629 ids.add(data[i])
1630 self.assert_eq(ids, data)
1631
1632 def test_dunder_sub2(self):
1633 IdentitySet = util.IdentitySet

Callers

nothing calls this directly

Calls 2

addMethod · 0.95
assert_eqMethod · 0.95

Tested by

no test coverage detected