test.test_poi_dataset   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 52
dl 0
loc 58
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
B TestPOIDataset.test_poi_dataset_opening_hours() 0 38 3
A TestPOIDataset.setUp() 0 2 1
1
# -*- coding: utf-8 -*-
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
3
try:
4
    import unittest
5
    import logging
6
    import sys
7
    from osm_poi_matchmaker.libs.poi_dataset import POIDataset
8
    from test.test_opening_hours_data import OPENING_HOURS_TEST_DATA
9
except ImportError as err:
10
    logging.error('Error %s import module: %s', __name__, err)
11
    logging.exception('Exception occurred')
12
13
    sys.exit(128)
14
15
16
class TestPOIDataset(unittest.TestCase):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
17
    def setUp(self):
18
        self.opening_hours = OPENING_HOURS_TEST_DATA
19
20
    def test_poi_dataset_opening_hours(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
21
        for i in self.opening_hours:
22
            p = POIDataset()
0 ignored issues
show
Coding Style Naming introduced by
Variable name "p" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
23
            p.nonstop = i['nonstop']
24
            p.mo_o = i['mo_o']
25
            p.tu_o = i['tu_o']
26
            p.we_o = i['we_o']
27
            p.th_o = i['th_o']
28
            p.fr_o = i['fr_o']
29
            p.sa_o = i['sa_o']
30
            p.su_o = i['su_o']
31
            p.mo_c = i['mo_c']
32
            p.tu_c = i['tu_c']
33
            p.we_c = i['we_c']
34
            p.th_c = i['th_c']
35
            p.fr_c = i['fr_c']
36
            p.sa_c = i['sa_c']
37
            p.su_c = i['su_c']
38
            p.summer_mo_o = i['summer_mo_o']
39
            p.summer_tu_o = i['summer_tu_o']
40
            p.summer_we_o = i['summer_we_o']
41
            p.summer_th_o = i['summer_th_o']
42
            p.summer_fr_o = i['summer_fr_o']
43
            p.summer_sa_o = i['summer_sa_o']
44
            p.summer_su_o = i['summer_su_o']
45
            p.summer_mo_c = i['summer_mo_c']
46
            p.summer_tu_c = i['summer_tu_c']
47
            p.summer_we_c = i['summer_we_c']
48
            p.summer_th_c = i['summer_th_c']
49
            p.summer_fr_c = i['summer_fr_c']
50
            p.summer_sa_c = i['summer_sa_c']
51
            p.summer_su_c = i['summer_su_c']
52
            p.lunch_break_start = i['lunch_break_start']
53
            p.lunch_break_stop = i['lunch_break_stop']
54
            p.public_holiday_open = i['public_holiday_open']
55
            with self.subTest():
56
                p.process_opening_hours()
57
                self.assertEqual(i['processed'], p.opening_hours)
58