2025-01-28 12:52:19 +01:00
|
|
|
import unittest
|
|
|
|
|
2025-01-28 13:53:10 +01:00
|
|
|
from Ex1 import countKey
|
|
|
|
|
|
|
|
|
2025-01-28 12:52:19 +01:00
|
|
|
class MyTestCase(unittest.TestCase):
|
|
|
|
def test_simple1(self):
|
2025-01-28 13:53:10 +01:00
|
|
|
self.assertEqual(
|
|
|
|
countKey([-3, 4, 2, 8, 9, 1, -3, -8, -4, 2, 8, 2, -8, 1, 3]),
|
|
|
|
4
|
|
|
|
)
|
|
|
|
|
|
|
|
def test_simple2(self):
|
|
|
|
self.assertEqual(
|
|
|
|
countKey([-4, 5, 6, -1500, 4, 7, 49, 60, -60, 82, -41, 1500, 1, -7]),
|
|
|
|
4
|
|
|
|
)
|
|
|
|
|
|
|
|
def test_simple3(self):
|
|
|
|
self.assertEqual(
|
|
|
|
countKey([-3, -2, -1, 1, 2, 5]),
|
|
|
|
2
|
|
|
|
)
|
2025-01-28 12:52:19 +01:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|