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)
def test_index_positive_err(self): s = SortedSet([1, 3, 8, 9]) with self.assertRaises(ValueError): s.index(2)
def test_index_positive(self): s = SortedSet([1, 3, 8, 9]) self.assertEqual(s.index(1), 0)
def test_slice(self): self.assertEqual(self.s[:1], SortedSet([1]))
def test_empty(self): s = SortedSet([])
def setUp(self): self.s = SortedSet([1, 2])
def test_repr_empy(self): s = SortedSet() self.assertEqual(repr(s), "SortedSet()")
def test_index_positive_err(self): s = SortedSet([1,3,8,9]) with self.assertRaises(ValueError): s.index(2)
def test_deff(self): s = SortedSet()
def test_dup(self): s = SortedSet([7, 7])
def test_not_idential(self): s = SortedSet([1, 2]) self.assertFalse(s != s)
def test_idential(self): s = SortedSet([1, 2]) self.assertTrue(s == s)
def test_eq(self): self.assertTrue(SortedSet([1, 2]) == SortedSet([1, 2]))
def test_from_seq(self): s = SortedSet([5, 7])
def setUp(self): self.s = SortedSet([4, 3, 5, 9, 7, 6])
def test_index_positive(self): s = SortedSet([1,3,8,9]) self.assertEqual(s.index(1),0)
def test_empty(self): s = SortedSet([3, 3, 3]) self.assertEqual(len(s), 1)
def test_count_one(self): s = SortedSet([1,3]) self.assertEqual(s.count(1),1)
def test_count_one(self): s = SortedSet([1, 3]) self.assertEqual(s.count(1), 1)