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