def test_is_subset(self):
     elements = ['Y', 'C', 'D']
     elements2 = ['C', 'G', 'U', 'D', 'T', 'Y']
     elements3 = ['P', 'H', 'Y', 'D', 'E', 'F']
     set1 = TreeSet(elements)
     set2 = TreeSet(elements2)
     set3 = TreeSet(elements3)
     assert set1.is_subset(set2) is False
     assert set1.is_subset(set3) is False
     assert set2.is_subset(set3) is False
Beispiel #2
0
 def test_is_subset(self):
     """Testing the is_subset method"""
     set_one = TreeSet(['C', 'B', 'A', 'E', 'D'])
     set_two = TreeSet(['A', 'B', 'C', 'I', 'H'])
     set_three = TreeSet(['A', 'B', 'C'])
     assert not set_one.is_subset(set_two)
     assert not set_two.is_subset(set_one)
     assert set_one.is_subset(set_three)
     assert set_two.is_subset(set_three)
     assert not set_three.is_subset(set_one)
     assert not set_three.is_subset(set_two)
 def test_subset(self):
     s1 = TreeSet([1, 2, 3, 4, 5])
     s2 = TreeSet([1, 2, 3, 4, 5, 6])
     assert s1.is_subset(s2) is True
     assert s2.is_subset(s1) is False