Exemplo n.º 1
0
 def test_first_largest(self):
     l = [(5, 'a'), (5, 'b'), (5, 'c')]
     self.assertEqual(_first_largest(l), (5, 'a'))
     l = [(5, 'c'), (5, 'b'), (5, 'a')]
     self.assertEqual(_first_largest(l), (5, 'c'))
     l = [(5, 'c'), (6, 'b'), (5, 'a')]
     self.assertEqual(_first_largest(l), (6, 'b'))
     # works for more than three entries
     l = [(5, 'c'), (6, 'b'), (5, 'a'), (7, 'd')]
     self.assertEqual(_first_largest(l), (7, 'd'))
Exemplo n.º 2
0
 def test_first_largest(self):
     input = [(5, 'a'), (5, 'b'), (5, 'c')]
     self.assertEqual(_first_largest(input), (5, 'a'))
     input = [(5, 'c'), (5, 'b'), (5, 'a')]
     self.assertEqual(_first_largest(input), (5, 'c'))
     input = [(5, 'c'), (6, 'b'), (5, 'a')]
     self.assertEqual(_first_largest(input), (6, 'b'))
     # works for more than three entries
     input = [(5, 'c'), (6, 'b'), (5, 'a'), (7, 'd')]
     self.assertEqual(_first_largest(input), (7, 'd'))
Exemplo n.º 3
0
 def test_first_largest(self):
     l = [(5, 'a'), (5, 'b'), (5, 'c')]
     self.assertEqual(_first_largest(l), (5, 'a'))
     l = [(5, 'c'), (5, 'b'), (5, 'a')]
     self.assertEqual(_first_largest(l), (5, 'c'))
     l = [(5, 'c'), (6, 'b'), (5, 'a')]
     self.assertEqual(_first_largest(l), (6, 'b'))
     # works for more than three entries
     l = [(5, 'c'), (6, 'b'), (5, 'a'), (7, 'd')]
     self.assertEqual(_first_largest(l), (7, 'd'))