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.

TestResource   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 15
Bugs 0 Features 0
Metric Value
wmc 6
c 15
b 0
f 0
dl 0
loc 26
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test_create_bank_account() 0 8 2
A test_path() 0 5 1
A test_list_bank_accounts() 0 9 3
1
try:  # pragma: no cover
2
    from unittest.mock import patch
3
except ImportError:  # pragma: no cover
4
    from mock import patch
5
import besepa
6
from besepa.resource import Resource
7
8
besepa.configure(api_key='dummy')
9
10
11
class TestResource(object):
12
13
    @patch('customers_test.besepa.Api.get', autospec=True)
14
    def test_path(self, mock):
15
        customers = besepa.Customer.all()
16
17
        mock.assert_called_once_with(customers.api, 'api/1/customers')
18
19
    @patch('customers_test.besepa.Api.post', autospec=True)
20
    def test_create_bank_account(self, mock):
21
        customer = besepa.Customer({'id': '1'})
22
        response = customer.create_bank_account({'iban': 'NL33ABNA0618708937'})
23
24
        mock.assert_called_once_with(
25
            customer.api, 'api/1/customers/1/bank_accounts', {'iban': 'NL33ABNA0618708937'}, {})
26
        assert response.error is None
27
28
    @patch('customers_test.besepa.Api.get', autospec=True)
29
    def test_list_bank_accounts(self, mock):
30
        customer = besepa.Customer({'id': '1'})
31
        mock.return_value = [{'id': '1', 'iban': 'NL33ABNA0618708937'}]
32
        response = customer.list_bank_accounts()
33
34
        mock.assert_called_once_with(response[0].api, 'api/1/customers/1/bank_accounts')
35
        assert len(response) == 1
36
        assert isinstance(response[0], Resource)
37