Completed
Push — master ( 3042bf...1724d9 )
by Allisson
18:05
created

charge_data()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
1
import os
2
3
import pytest
4
5
from vindi.api import get_api_instance
6
7
8
@pytest.fixture
9
def api():
10
    return get_api_instance(token=os.getenv('API_TOKEN', ''))
11
12
13
@pytest.fixture
14
def customer_data():
15
    return {
16
        'customer': {
17
            'id': 2481112,
18
            'name': 'John Doe',
19
            'email': '[email protected]',
20
            'registry_code': None,
21
            'code': None,
22
            'notes': None,
23
            'status': 'inactive',
24
            'created_at': '2017-04-19T13:08:51.795-03:00',
25
            'updated_at': '2017-04-19T13:08:51.795-03:00',
26
            'metadata': {},
27
            'address': {
28
                'street': None,
29
                'number': None,
30
                'additional_details': None,
31
                'zipcode': None,
32
                'neighborhood': None,
33
                'city': None,
34
                'state': None,
35
                'country': None
36
            },
37
            'phones': []
38
        }
39
    }
40
41
42
@pytest.fixture
43
def product_data():
44
    return {
45
        'product': {
46
            'id': 82534,
47
            'name': 'Product One',
48
            'code': 'product-one',
49
            'unit': None,
50
            'status': 'active',
51
            'description': None,
52
            'invoice': 'always',
53
            'created_at': '2017-04-20T08:27:28.000-03:00',
54
            'updated_at': '2017-04-20T08:27:28.000-03:00',
55
            'pricing_schema': {
56
                'id': 1196727,
57
                'short_format': 'R$ 100,00',
58
                'price': '100.0',
59
                'minimum_price': None,
60
                'schema_type': 'flat',
61
                'pricing_ranges': [],
62
                'created_at': '2017-04-20T08:27:28.000-03:00'
63
            },
64
            'metadata': {}
65
        }
66
    }
67
68
69
@pytest.fixture
70
def payment_method_data():
71
    return {
72
        'payment_method': {
73
            'id': 17293
74
        }
75
    }
76
77
78
@pytest.fixture
79
def payment_profile_data():
80
    return {
81
        'id': 2284520,
82
        'holder_name': 'John Doe',
83
        'card_expiration': '12/2020',
84
        'card_number': '5555555555555557',
85
        'card_cvv': '123',
86
        'payment_method_code': 'credit_card',
87
        'payment_company_code': 'mastercard',
88
        'customer_id': 2481258
89
    }
90
91
92
@pytest.fixture
93
def bill_data():
94
    return {
95
        'id': 7064381,
96
        'customer_id': 2481258,
97
        'code': 'my-first-bill',
98
        'installments': 1,
99
        'payment_method_code': 'credit_card',
100
        'bill_items': [{
101
            'product_code': 'product-1',
102
            'amount': 100.00
103
        }],
104
        'payment_profile': {
105
            'id': 2284520
106
        }
107
    }
108
109
110
@pytest.fixture
111
def charge_data():
112
    return {
113
        'id': 6810923,
114
        'amount': '100.0',
115
        'status': 'pending',
116
        'due_at': '2017-04-24T23:59:59.000-03:00',
117
    }
118