예제 #1
0
 def testGenerator(self):
     self.assertEqual(navigation.first(lambda x: x, xrange(5)), 1)
예제 #2
0
 def testMatch(self):
     self.assertEqual(navigation.first(lambda x: x, [False, True]), True)
예제 #3
0
 def testFirstMatch(self):
     self.assertEqual(navigation.first(lambda x: x, [1, 2]), 1)
예제 #4
0
 def testEmptyList(self):
     self.assertEqual(navigation.first(lambda x: x, []), None)
예제 #5
0
 def testNoMatchInList(self):
     self.assertEqual(navigation.first(lambda x: x, [False]), None)
예제 #6
0
 def testGenerator(self):
     self.assertEqual(navigation.first(lambda x: x, range(5)), 1)
예제 #7
0
 def testFirstMatch(self):
     self.assertEqual(navigation.first(lambda x: x, [1, 2]), 1)
예제 #8
0
 def testMatch(self):
     self.assertEqual(navigation.first(lambda x: x, [False, True]), True)
예제 #9
0
 def testNoMatchInList(self):
     self.assertEqual(navigation.first(lambda x: x, [False]), None)
예제 #10
0
 def testEmptyList(self):
     self.assertEqual(navigation.first(lambda x: x, []), None)