MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_set_comparisons

Method test_set_comparisons

test/ext/test_associationproxy.py:797–829  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

795 p1.children -= ["c", "d"]
796
797 def test_set_comparisons(self):
798 Parent = self.classes.Parent
799
800 p1 = Parent("P1")
801 p1.children = ["a", "b", "c"]
802 control = {"a", "b", "c"}
803
804 for other in (
805 {"a", "b", "c"},
806 {"a", "b", "c", "d"},
807 {"a"},
808 {"a", "b"},
809 {"c", "d"},
810 {"e", "f", "g"},
811 set(),
812 ):
813 eq_(p1.children.union(other), control.union(other))
814 eq_(p1.children.difference(other), control.difference(other))
815 eq_((p1.children - other), (control - other))
816 eq_(p1.children.intersection(other), control.intersection(other))
817 eq_(
818 p1.children.symmetric_difference(other),
819 control.symmetric_difference(other),
820 )
821 eq_(p1.children.issubset(other), control.issubset(other))
822 eq_(p1.children.issuperset(other), control.issuperset(other))
823
824 self.assert_((p1.children == other) == (control == other))
825 self.assert_((p1.children != other) == (control != other))
826 self.assert_((p1.children < other) == (control < other))
827 self.assert_((p1.children <= other) == (control <= other))
828 self.assert_((p1.children > other) == (control > other))
829 self.assert_((p1.children >= other) == (control >= other))
830
831 def test_set_comparison_empty_to_empty(self):
832 # test issue #3265 which was fixed in Python version 2.7.8

Callers

nothing calls this directly

Calls 9

eq_Function · 0.90
ParentClass · 0.70
unionMethod · 0.45
differenceMethod · 0.45
intersectionMethod · 0.45
symmetric_differenceMethod · 0.45
issubsetMethod · 0.45
issupersetMethod · 0.45
assert_Method · 0.45

Tested by

no test coverage detected