Exemplo n.º 1
0
 def test_index_positive(self):
     s = SortedSet([1, 5, 8, 9])
     self.assertEqual(s.index(8), 2)
Exemplo n.º 2
0
 def test_index_negative(self):
     s = SortedSet([1, 5, 8, 9])
     with self.assertRaises(ValueError):
         s.index(15)
Exemplo n.º 3
0
 def test_index_positive(self):
     s = SortedSet({1, 2, 3, 9, 4, 6})
     self.assertEqual(s.index(3), 2)
Exemplo n.º 4
0
 def test_index_negative(self):
     s = SortedSet({1, 2, 3, 9, 4, 6})
     with self.assertRaises(ValueError):
         s.index(58)
Exemplo n.º 5
0
 def test_negative_index(self):
     s = SortedSet([1, 2, 3, 4])
     with self.assertRaises(ValueError):
         s.index(14)
Exemplo n.º 6
0
	def test_index_positive(self):
		s = SortedSet([2, 4, 6, 7])
		self.assertEqual(s.index(2), 6)
Exemplo n.º 7
0
 def test_index_positive(self):
     s = SortedSet([1, 3, 5, 7])
     self.assertEqual(s.index(5), 2)
Exemplo n.º 8
0
 def test_positive_index(self):
     s = SortedSet([1, 2, 3, 4])
     self.assertEqual(1, s.index(2))
 def test_index_negative(self):
     s = SortedSet([1, 5, 8, 9])
     with self.assertRaises(ValueError):
         s.index(15)
Exemplo n.º 10
0
 def test_index_positive(self):
     s = SortedSet([1, 5, 8, 9])
     self.assertEqual(s.index(8), 2)
Exemplo n.º 11
0
 def test_index_positive(self):
     s = SortedSet([1, 2, 3])
     self.assertEqual(s.index(1), 0)
Exemplo n.º 12
0
 def test_index_negative(self):
     s = SortedSet([7, 14, 22, 23])
     with self.assertRaises(ValueError):
         s.index(15)
Exemplo n.º 13
0
 def test_index_positive(self):
     s = SortedSet([7, 14, 22, 23])
     self.assertEqual(s.index(22), 2)