-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_unit4.py
61 lines (44 loc) · 1.76 KB
/
test_unit4.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
import logging
from unit4.tests import unit4
def test_transactions():
logging.info("start test transactions...")
logging.info("finished test transactions!")
def test_request_access_token():
logging.info("requesting access token...")
unit4.request_access_token()
logging.info("access token succesfully obtained!")
def test_list_administraties():
logging.info("start test list administrations...")
data = unit4.request_data(endpoint="api/AdministrationGroupList/All")
print(len(data))
logging.info("test list administrations finished!")
def test_fiscal_year_info():
logging.info("start test fiscal year info...")
administration = "MVL94315"
fiscal_year = 2021
data = unit4.request_data(endpoint=f"api/{administration}/FiscalYearInfo/{fiscal_year}")
print(len(data))
logging.info("test list fiscal year info finished!")
def test_customer_info_list():
logging.info("start test customer info...")
administration = "MVL94315"
fiscal_year = 2021
data = unit4.request_data(endpoint=f"api/{administration}/FiscalYearInfo/{fiscal_year}")
print(data)
logging.info("test list customer info finished!")
def test_accounts():
logging.info("start test accounts to dataframe...")
data = unit4.accounts(database="MVL94315", fiscal_year=2021)
print(data.shape)
logging.info("test accounts to dataframe finished!")
def test_account_info():
logging.info("start test accounts to dataframe...")
data = unit4.account_info(database="MVL94315", account_id="000900")
print(data.shape)
logging.info("test accounts to dataframe finished!")
if __name__ == "__main__":
test_request_access_token()
test_list_administraties()
test_fiscal_year_info()
test_accounts()
test_account_info()