File size: 362 Bytes
03a907a
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import unittest
from dataset.problem_7.buggy import top_k_frequent


class TestTopKFrequent(unittest.TestCase):
    def test_simple(self):
        self.assertEqual(top_k_frequent([1, 1, 1, 2, 2, 3], 2), [1, 2])

    def test_single(self):
        self.assertEqual(top_k_frequent([4, 4, 5], 1), [4])


if __name__ == "__main__":
    unittest.main()