aboutsummaryrefslogtreecommitdiff
path: root/challenge-277/sgreen/python/test.py
blob: fd5e90dbf26a246810e9d5aec976f5d536ebee89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3

import unittest
ch_1 = __import__('ch-1')
ch_2 = __import__('ch-2')


class TestClass(unittest.TestCase):
    def test_ch_1(self):
        self.assertEqual(
            ch_1.count_common(
                ["Perl", "is", "my", "friend"],
                ["Perl", "and", "Raku", "are", "friend"]),
            2)
        self.assertEqual(
            ch_1.count_common(
                ["Perl", "and", "Python", "are", "very", "similar"],
                ["Python", "is", "top", "in", "guest", "languages"]),
            1)
        self.assertEqual(
            ch_1.count_common(
                ["Perl", "is", "imperative", "Lisp", "is", "functional"],
                ["Crystal", "is", "similar", "to", "Ruby"]),
            0)

    def test_ch_2(self):
        self.assertEqual(ch_2.strong_pair([1, 2, 3, 4, 5]), 4)
        self.assertEqual(ch_2.strong_pair([5, 7, 1]), 1)


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