Пример #1
0
 def test_reversed(self):
     s = SortedSet([1, 3])
     r = reversed(s)
     self.assertEqual(next(r), 3)
     self.assertEqual(next(r), 1)
     with self.assertRaises(StopIteration):
         next(r)
Пример #2
0
 def test_index_positive_err(self):
     s = SortedSet([1, 3, 8, 9])
     with self.assertRaises(ValueError):
         s.index(2)
Пример #3
0
 def test_index_positive(self):
     s = SortedSet([1, 3, 8, 9])
     self.assertEqual(s.index(1), 0)
Пример #4
0
 def test_slice(self):
     self.assertEqual(self.s[:1], SortedSet([1]))
Пример #5
0
 def test_empty(self):
     s = SortedSet([])
Пример #6
0
 def setUp(self):
     self.s = SortedSet([1, 2])
Пример #7
0
 def test_repr_empy(self):
     s = SortedSet()
     self.assertEqual(repr(s), "SortedSet()")
Пример #8
0
 def test_index_positive_err(self):
     s = SortedSet([1,3,8,9])
     with self.assertRaises(ValueError):
         s.index(2)
Пример #9
0
 def test_deff(self):
     s = SortedSet()
Пример #10
0
 def test_dup(self):
     s = SortedSet([7, 7])
Пример #11
0
 def test_not_idential(self):
     s = SortedSet([1, 2])
     self.assertFalse(s != s)
Пример #12
0
 def test_idential(self):
     s = SortedSet([1, 2])
     self.assertTrue(s == s)
Пример #13
0
 def test_eq(self):
     self.assertTrue(SortedSet([1, 2]) == SortedSet([1, 2]))
Пример #14
0
 def test_from_seq(self):
     s = SortedSet([5, 7])
Пример #15
0
 def setUp(self):
     self.s = SortedSet([4, 3, 5, 9, 7, 6])
Пример #16
0
 def test_index_positive(self):
     s = SortedSet([1,3,8,9])
     self.assertEqual(s.index(1),0)
Пример #17
0
 def test_empty(self):
     s = SortedSet([3, 3, 3])
     self.assertEqual(len(s), 1)
Пример #18
0
 def test_count_one(self):
     s = SortedSet([1,3])
     self.assertEqual(s.count(1),1)
Пример #19
0
 def test_count_one(self):
     s = SortedSet([1, 3])
     self.assertEqual(s.count(1), 1)