(self)
| 736 | assert_raises(TypeError, set, [p1.children]) |
| 737 | |
| 738 | def test_set_comparisons(self): |
| 739 | Parent = self.classes.Parent |
| 740 | |
| 741 | p1 = Parent("P1") |
| 742 | p1.children = ["a", "b", "c"] |
| 743 | control = {"a", "b", "c"} |
| 744 | |
| 745 | for other in ( |
| 746 | {"a", "b", "c"}, |
| 747 | {"a", "b", "c", "d"}, |
| 748 | {"a"}, |
| 749 | {"a", "b"}, |
| 750 | {"c", "d"}, |
| 751 | {"e", "f", "g"}, |
| 752 | set(), |
| 753 | ): |
| 754 | eq_(p1.children.union(other), control.union(other)) |
| 755 | eq_(p1.children.difference(other), control.difference(other)) |
| 756 | eq_((p1.children - other), (control - other)) |
| 757 | eq_(p1.children.intersection(other), control.intersection(other)) |
| 758 | eq_( |
| 759 | p1.children.symmetric_difference(other), |
| 760 | control.symmetric_difference(other), |
| 761 | ) |
| 762 | eq_(p1.children.issubset(other), control.issubset(other)) |
| 763 | eq_(p1.children.issuperset(other), control.issuperset(other)) |
| 764 | |
| 765 | self.assert_((p1.children == other) == (control == other)) |
| 766 | self.assert_((p1.children != other) == (control != other)) |
| 767 | self.assert_((p1.children < other) == (control < other)) |
| 768 | self.assert_((p1.children <= other) == (control <= other)) |
| 769 | self.assert_((p1.children > other) == (control > other)) |
| 770 | self.assert_((p1.children >= other) == (control >= other)) |
| 771 | |
| 772 | def test_set_comparison_empty_to_empty(self): |
| 773 | # test issue #3265 which was fixed in Python version 2.7.8 |
nothing calls this directly
no test coverage detected