-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathconftest.py
154 lines (134 loc) · 3.78 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
"""Test fixtures."""
import pytest
from pathlib import Path
import datetime
import tuttle
from tuttle.model import Project, Client, Address, Contact, User, BankAccount, Contract
@pytest.fixture
def demo_contact():
return Contact(
fist_name="Sam",
last_name="Lowry",
email="[email protected]",
address=Address(
street="Main Street",
number="9999",
postal_code="55555",
city="Sao Paolo",
country="Brazil",
),
)
@pytest.fixture
def demo_user():
user = User(
first_name="Harry",
last_name="Tuttle",
subtitle="Heating Engineer",
website="https://tuttle-dev.github.io/tuttle/",
email="[email protected]",
phone_number="+55555555555",
VAT_number="27B-6",
address=Address(
name="Harry Tuttle",
street="Main Street",
number="450",
city="Sao Paolo",
postal_code="555555",
country="Brazil",
),
bank_account=BankAccount(
name="Giro",
IBAN="BZ99830994950003161565",
BIC="BANKINFO101",
),
)
return user
@pytest.fixture
def demo_clients():
central_services = Client(
name="Central Services",
invoicing_contact=Contact(
first_name="Central",
last_name="Services",
email="[email protected]",
address=Address(
street="Main Street",
number="42",
postal_code="55555",
city="Sao Paolo",
country="Brazil",
),
),
)
sam_lowry = Client(
name="Sam Lowry",
invoicing_contact=Contact(
first_name="Sam",
last_name="Lowry",
email="[email protected]",
address=Address(
street="Main Street",
number="9999",
postal_code="55555",
city="Sao Paolo",
country="Brazil",
),
),
)
clients = [
central_services,
sam_lowry,
]
return clients
@pytest.fixture
def demo_contracts(demo_clients):
heating_engineering_contract = Contract(
title="Heating Engineering Contract",
client=demo_clients[0],
rate=100.00,
currency="EUR",
unit=tuttle.time.TimeUnit.hour,
units_per_workday=8,
term_of_payment=14,
billing_cycle=tuttle.time.Cycle.monthly,
)
heating_repair_contract = Contract(
title="Heating Repair Contract",
client=demo_clients[1],
rate=50.00,
currency="EUR",
unit=tuttle.time.TimeUnit.hour,
units_per_workday=8,
term_of_payment=14,
billing_cycle=tuttle.time.Cycle.monthly,
)
contracts = [
heating_engineering_contract,
heating_repair_contract,
]
return contracts
@pytest.fixture
def demo_projects(demo_contracts):
heating_engineering = Project(
title="Heating Engineering",
tag="#HeatingEngineering",
contract=demo_contracts[0],
start_date=datetime.date(2022, 1, 1),
end_date=datetime.date(2022, 3, 31),
)
heating_repair = Project(
title="Heating Repair",
tag="#HeatingRepair",
contract=demo_contracts[1],
start_date=datetime.date(2022, 1, 1),
end_date=datetime.date(2022, 3, 31),
)
projects = [heating_engineering, heating_repair]
return projects
@pytest.fixture
def demo_calendar_timetracking():
timetracking_calendar_path = Path("tuttle_tests/data/TuttleDemo-TimeTracking.ics")
cal = tuttle.calendar.ICSCalendar(
path=timetracking_calendar_path, name="TimeTracking"
)
return cal