MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_dunder_ior

Method test_dunder_ior

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

Source from the content-addressed store, hash-verified

1937 pass # TODO
1938
1939 def test_dunder_ior(self):
1940 super_, sub_, _, _, _, _ = self._create_sets()
1941
1942 # basic set math
1943 sub_ |= super_
1944 eq_(sub_, super_)
1945 super_ |= sub_
1946 eq_(super_, super_)
1947
1948 # totally different sets
1949 unique1 = util.IdentitySet([1])
1950 unique2 = util.IdentitySet([2])
1951 unique1 |= unique2
1952 eq_(unique1, util.IdentitySet([1, 2]))
1953 eq_(unique2, util.IdentitySet([2]))
1954
1955 # not an IdentitySet
1956 def should_raise():
1957 unique = util.IdentitySet([1])
1958 not_an_identity_set = object()
1959 unique |= not_an_identity_set
1960
1961 assert_raises(TypeError, should_raise)
1962
1963 def test_difference(self):
1964 _, _, twin1, twin2, _, _ = self._create_sets()

Callers

nothing calls this directly

Calls 3

_create_setsMethod · 0.95
eq_Function · 0.90
assert_raisesFunction · 0.90

Tested by

no test coverage detected