示例#1
0
 def test_set_count_false_items(self):
     inventory = [
         'apple', 'lemon', 'apple', 'orange', 'lemon', 'lemon', None, False,
         ''
     ]
     expected = [('lemon', 3), ('apple', 2), ('orange', 1)]
     result = plugins.set_count(inventory)
     self.assertEqual(result, expected)
 def test_set_count(self):
     inventory = ['apple', 'lemon', 'apple', 'orange', 'lemon', 'lemon']
     expected = [('lemon', 3), ('apple', 2), ('orange', 1)]
     result = plugins.set_count(inventory)
     self.assertEqual(result, expected)