test_date_time_converter.Tests.test_Basics()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 3
Code Lines 3

Duplication

Lines 3
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nop 1
dl 3
loc 3
rs 10
c 0
b 0
f 0
1
import unittest
2
3
from date_time_converter import date_time
4
5
6 View Code Duplication
class Tests(unittest.TestCase):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7
    TESTS = {
8
        "Basics": [
9
            {
10
                "input": '01.01.2000 00:00',
11
                "answer": "1 January 2000 year 0 hours 0 minutes",
12
            },
13
            {
14
                "input": '09.05.1945 06:30',
15
                "answer": "9 May 1945 year 6 hours 30 minutes",
16
            },
17
        ],
18
        "Extra": [
19
            {
20
                "input": '20.11.1990 03:55',
21
                "answer": "20 November 1990 year 3 hours 55 minutes",
22
            },
23
            {
24
                "input": '09.07.1995 16:50',
25
                "answer": "9 July 1995 year 16 hours 50 minutes",
26
            },
27
            {
28
                "input": '11.04.1812 01:01',
29
                "answer": "11 April 1812 year 1 hour 1 minute",
30
            },
31
        ],
32
    }
33
34
    def test_Basics(self):
35
        for i in self.TESTS['Basics']:
36
            assert date_time(i['input']) == i['answer']
37
38
    def test_Extra(self):
39
        for i in self.TESTS['Extra']:
40
            assert date_time(i['input']) == i['answer']
41
42
43
if __name__ == "__main__":  # pragma: no cover
44
    unittest.main()
45