예제 #1
0
 def test_no_length_method(self):
     listy = Listy(list(range(200)))
     x = 100
     self.assertEqual(100, find(x, listy))
예제 #2
0
 def test_empty_listy(self):
     listy = []
     x = 42
     self.assertEqual(-1, find(x, listy))
예제 #3
0
 def test_large_listy(self):
     listy = range(1000000)
     x = 999999
     self.assertEqual(999999, find(x, listy))
예제 #4
0
 def test_finds_index3(self):
     listy = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1376]
     x = 4
     self.assertEqual(0, find(x, listy))
예제 #5
0
 def test_not_found(self):
     listy = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1376]
     x = 16
     self.assertEqual(-1, find(x, listy))
예제 #6
0
 def test_no_length_method(self):
     listy = Listy(list(range(200)))
     x = 100
     self.assertEqual(100, find(x, listy))
예제 #7
0
 def test_finds_index1(self):
     listy = [2, 4, 7, 22, 23, 55, 65, 102, 10002]
     x = 65
     self.assertEqual(6, find(x, listy))
예제 #8
0
 def test_large_listy(self):
     listy = range(1000000)
     x = 999999
     self.assertEqual(999999, find(x, listy))
예제 #9
0
 def test_empty_listy(self):
     listy = []
     x = 42
     self.assertEqual(-1, find(x, listy))
예제 #10
0
 def test_not_found(self):
     listy = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1376]
     x = 16
     self.assertEqual(-1, find(x, listy))
예제 #11
0
 def test_finds_index3(self):
     listy = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1376]
     x = 4
     self.assertEqual(0, find(x, listy))
예제 #12
0
 def test_finds_index1(self):
     listy = [2, 4, 7, 22, 23, 55, 65, 102, 10002]
     x = 65
     self.assertEqual(6, find(x, listy))