GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Failed Conditions
Pull Request — master (#17)
by Yngve
03:33
created

tests.payment_text_test   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 51
dl 0
loc 98
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A PaymentTextTest.test_clean() 0 9 2
1
# pyre-strict
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
3
import unittest
4
from typing import List, Dict
5
from paytext import PaymentText
6
7
EXAMPLE_TEXTS: List[Dict[str, str]] = [
8
    {
9
        'input': '',
10
        'expected_output': '',
11
    },
12
    {
13
        'input': 'COINBASE UK, LTD                   EUR              15,94',
14
        'expected_output': 'COINBASE UK, LTD',
15
    },
16
    {
17
        'input': 'COINBASE UK, LTD                   EUR              182,12',
18
        'expected_output': 'COINBASE UK, LTD',
19
    },
20
    {
21
        'input': 'Fra: Solan Gundersen 18.06.18',
22
        'expected_output': 'Fra: Solan Gundersen',
23
    },
24
    {
25
        'input': '*4274 25.06 NOK 4101.00 WWW.TICKET.NO Kurs: 1.0000',
26
        'expected_output': 'WWW.TICKET.NO',
27
    },
28
    {
29
        'input': 'OBOS FACTORING',
30
        'expected_output': 'OBOS FACTORING',
31
    },
32
    {
33
        'input': '30.06 COOP PRIX VG-HU AKERSGT 55 OSLO',
34
        'expected_output': 'COOP PRIX VG-HU AKERSGT 55 OSLO',
35
    },
36
    {
37
        'input': '*8877 01.07 USD 12.99 IRRADIATED SOFTWARE Kurs: 8.3718',
38
        'expected_output': 'IRRADIATED SOFTWARE',
39
    },
40
    {
41
        'input': '*3951 01.07 EUR 4.00 GOOGLE *SVCSAPPS_hoise Kurs: 9.7250',
42
        'expected_output': 'GOOGLE *SVCSAPPS_hoise',
43
    },
44
    {
45
        'input': '*9090 29.06 USD 1.00 SAM HARRIS MEDIA INC Kurs: 8.3700',
46
        'expected_output': 'SAM HARRIS MEDIA INC',
47
    },
48
    {
49
        'input': '05.07 KIWI 471 BISLET THERESESGT 3 OSLO',
50
        'expected_output': 'KIWI 471 BISLET THERESESGT 3 OSLO',
51
    },
52
    {
53
        'input': '04.07 DEN NORSKE TURISTFOR. OSLO',
54
        'expected_output': 'DEN NORSKE TURISTFOR. OSLO',
55
    },
56
    {
57
        'input': 'Nettgiro til: Universitetet i Betalt: 05.07.18',
58
        'expected_output': 'Nettgiro til: Universitetet i',
59
    },
60
    {
61
        'input': '05.07 REMA SANNERGATA SANNERGATA 3 OSLO',
62
        'expected_output': 'REMA SANNERGATA SANNERGATA 3 OSLO',
63
    },
64
    {
65
        'input': 'Vipps',
66
        'expected_output': 'Vipps',
67
    },
68
    {
69
        'input': '04.07 SKOM.DAGESTAD JOSEFINEGT.  OSLO',
70
        'expected_output': 'SKOM.DAGESTAD JOSEFINEGT. OSLO',
71
    },
72
    {
73
        'input': '*4321 29.06 USD 50.00 ITUNES.COM/BILL Rate: 1.0000',
74
        'expected_output': 'ITUNES.COM/BILL',
75
    },
76
    {
77
        'input': '*1234 01.07 NOK 215.00 ITUNES.COM/BILL Kurs: 1.0000',
78
        'expected_output': 'ITUNES.COM/BILL',
79
    },
80
]
81
82
83
class PaymentTextTest(unittest.TestCase):
1 ignored issue
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
84
    def test_clean(self) -> None:
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
85
        for example_text in EXAMPLE_TEXTS:
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
86
            text = PaymentText(example_text['input'])
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
87
88
            text.clean()
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
89
90
            self.assertEqual(
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
91
                str(text),
92
                example_text['expected_output'],
93
            )
94
95
96
if __name__ == '__main__':
97
    unittest.main()
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
98