Beispiel #1
0
 def test_positive_unequal(self):
     self.assertTrue(SortedSet([4, 5, 6]) != SortedSet([1, 2, 3]))
Beispiel #2
0
 def test_ten(self):
     s = SortedSet(range(10))
     self.assertEqual(len(s), 10)
Beispiel #3
0
 def test_empty(self):
     s = SortedSet([])
Beispiel #4
0
 def test_isdisjoint_positive(self):
     s = SortedSet({1, 2, 3})
     t = [4, 5, 6]
     self.assertTrue(s.isdisjoint(t))
Beispiel #5
0
 def test_empty(self):
     s = SortedSet()
     self.assertEqual(len(s), 0)
Beispiel #6
0
 def test_intersection(self):
     s = SortedSet({1, 2, 3})
     t = [2, 3, 4]
     self.assertEqual(s.intersection(t), SortedSet({2, 3}))
Beispiel #7
0
 def test_symmetric_difference(self):
     s = SortedSet({1, 2, 3})
     t = [2, 3, 4]
     self.assertEqual(s.symmetric_difference(t), SortedSet({1, 4}))
Beispiel #8
0
 def test_default_empty(self):
     s = SortedSet()
Beispiel #9
0
 def test_gt_positive(self):
     s = SortedSet({1, 2, 3})
     t = SortedSet({1, 2})
     self.assertTrue(s > t)
Beispiel #10
0
 def test_lt_negative(self):
     s = SortedSet({1, 2, 3})
     t = SortedSet({1, 2, 3})
     self.assertFalse(s < t)
Beispiel #11
0
 def test_le_lt_positive(self):
     s = SortedSet({1, 2})
     t = SortedSet({1, 2, 3})
     self.assertTrue(s <= t)
Beispiel #12
0
 def test_identical(self):
     s = SortedSet([10, 11, 12])
     self.assertFalse(s != s)
Beispiel #13
0
 def test_type_mismatch(self):
     self.assertTrue(SortedSet([1, 2, 3]) != [1, 2, 3])
Beispiel #14
0
 def test_negative_unequal(self):
     self.assertFalse(SortedSet([4, 5, 6]) != SortedSet([6, 5, 4]))
Beispiel #15
0
 def test_symmetric_difference(self):
     s = SortedSet({1, 2, 3})
     t = SortedSet({2, 3, 4})
     self.assertEqual(s ^ t, SortedSet({1, 4}))
Beispiel #16
0
 def test_ge_eq_positive(self):
     s = SortedSet({1, 2, 3})
     t = SortedSet({1, 2, 3})
     self.assertTrue(s >= t)
Beispiel #17
0
 def test_difference(self):
     s = SortedSet({1, 2, 3})
     t = SortedSet({2, 3, 4})
     self.assertEqual(s - t, SortedSet({1}))
Beispiel #18
0
 def test_ge_negative(self):
     s = SortedSet({1, 2})
     t = SortedSet({1, 2, 3})
     self.assertFalse(s >= t)
Beispiel #19
0
 def test_union(self):
     s = SortedSet({1, 2, 3})
     t = [2, 3, 4]
     self.assertEqual(s.union(t), SortedSet({1, 2, 3, 4}))
Beispiel #20
0
 def test_issuperset_positive(self):
     s = SortedSet({1, 2, 3})
     t = [1, 2, 3]
     self.assertTrue(s.issuperset(t))
Beispiel #21
0
 def test_difference(self):
     s = SortedSet({1, 2, 3})
     t = [2, 3, 4]
     self.assertEqual(s.difference(t), SortedSet({1}))
Beispiel #22
0
 def setUp(self):
     self.s = SortedSet([6, 7, 3, 9])
Beispiel #23
0
 def test_isdisjoint_negative(self):
     s = SortedSet({1, 2, 3})
     t = [3, 4, 5]
     self.assertFalse(s.isdisjoint(t))
Beispiel #24
0
 def test_issuperset_negative(self):
     s = SortedSet({1, 2})
     t = [1, 2, 3]
     self.assertFalse(s.issuperset(t))
Beispiel #25
0
 def test_one(self):
     s = SortedSet([42])
     self.assertEqual(len(s), 1)
Beispiel #26
0
 def test_intersection(self):
     s = SortedSet({1, 2, 3})
     t = SortedSet({2, 3, 4})
     self.assertEqual(s & t, SortedSet({2, 3}))
Beispiel #27
0
 def test_with_duplicates(self):
     s = SortedSet([5, 5, 5])
     self.assertEqual(len(s), 1)
Beispiel #28
0
 def test_union(self):
     s = SortedSet({1, 2, 3})
     t = SortedSet({2, 3, 4})
     self.assertEqual(s | t, SortedSet({1, 2, 3, 4}))
Beispiel #29
0
 def setUp(self):
     self.s = SortedSet([7, 2, 1, 1, 9])
Beispiel #30
0
 def test_identical(self):
     s = SortedSet([10, 11, 12])
     self.assertTrue(s == s)