services are checked

This commit is contained in:
2024-11-08 17:14:02 +03:00
parent a5b1e0b2f4
commit c5b771e5cb
82 changed files with 1720 additions and 869 deletions

View File

@@ -1,4 +1,2 @@
if __name__ == "__main__":
print("service_app_test is running")

View File

@@ -3,16 +3,18 @@ from test_application.evyos.datas.get_occupants_codes import get_occupants_types
from test_application.evyos.datas.get_type_codes import get_type_codes_key_and_class
decision_book_items_dict = lambda token, item_comment, info_type_uu_id, unit_price, is_fixed, st, ed: {
"token": token,
"item_comment": f"Test {item_comment}",
"info_type_uu_id": info_type_uu_id,
"unit_price": unit_price,
"unit_price_is_fixed": is_fixed,
"debit_start_date": st,
"debit_end_date": ed,
**active_and_confirmed,
}
decision_book_items_dict = (
lambda token, item_comment, info_type_uu_id, unit_price, is_fixed, st, ed: {
"token": token,
"item_comment": f"Test {item_comment}",
"info_type_uu_id": info_type_uu_id,
"unit_price": unit_price,
"unit_price_is_fixed": is_fixed,
"debit_start_date": st,
"debit_end_date": ed,
**active_and_confirmed,
}
)
def create_decision_book_items(decision_book_items):
@@ -70,8 +72,12 @@ def collect_invitation_to_building_residents(
def create_decision_book_items_with_occupant_user(
writers_token: str, unit_price: float, is_fixed: bool, info_type_uu_id: str,
start_date: str = None, end_date: str = None
writers_token: str,
unit_price: float,
is_fixed: bool,
info_type_uu_id: str,
start_date: str = None,
end_date: str = None,
):
print("create_decision_book_items_with_occupant_user : ", writers_token)
list_of_items = [
@@ -82,7 +88,7 @@ def create_decision_book_items_with_occupant_user(
unit_price=unit_price,
is_fixed=is_fixed,
st=start_date,
ed=end_date
ed=end_date,
),
]
for item in list_of_items:
@@ -92,14 +98,21 @@ def create_decision_book_items_with_occupant_user(
def run_decision_book_items(
writers_token, unit_price, info_type_uu_id, is_fixed, start_date=None, end_date=None
writers_token, unit_price, info_type_uu_id, is_fixed, start_date=None, end_date=None
):
if start_date and end_date:
create_decision_book_items_with_occupant_user(
writers_token=writers_token, unit_price=unit_price, is_fixed=is_fixed, info_type_uu_id=info_type_uu_id,
start_date=start_date, end_date=end_date
writers_token=writers_token,
unit_price=unit_price,
is_fixed=is_fixed,
info_type_uu_id=info_type_uu_id,
start_date=start_date,
end_date=end_date,
)
else:
create_decision_book_items_with_occupant_user(
writers_token=writers_token, unit_price=unit_price, is_fixed=is_fixed, info_type_uu_id=info_type_uu_id,
writers_token=writers_token,
unit_price=unit_price,
is_fixed=is_fixed,
info_type_uu_id=info_type_uu_id,
)

View File

@@ -20,7 +20,7 @@ login_creds_employee = {
"access_key": "karatay.berkay.sup@evyos.com.tr",
"password": "string",
"remember_me": False,
"password_token": ""
"password_token": "",
}
access_key_president = "bmanco@example.net"
login_creds_occupant = {
@@ -28,7 +28,7 @@ login_creds_occupant = {
"access_key": access_key_president,
"password": "string",
"remember_me": False,
"password_token": "o_2Y_yXS-cl6MxLbzLrXQetXTlDLD3UBDTQNa_mBMyzSOVIgx3LGbnufLRJjd4g6BWFbwVgJIUxbK-Pi0R5dwxfVJKyoEeDdej40uRHSsElKR16nvnqgFB_BJ4nmyN0KSunZHra5NqHJor17EGExOSmlttZV5dC7vFsrc-GUkg"
"password_token": "o_2Y_yXS-cl6MxLbzLrXQetXTlDLD3UBDTQNa_mBMyzSOVIgx3LGbnufLRJjd4g6BWFbwVgJIUxbK-Pi0R5dwxfVJKyoEeDdej40uRHSsElKR16nvnqgFB_BJ4nmyN0KSunZHra5NqHJor17EGExOSmlttZV5dC7vFsrc-GUkg",
}
wrt_creds_occupant = {
"domain": "evyos.com.tr",
@@ -43,7 +43,10 @@ add_with_occupant = True
assign_people_to_create_item = 3
# selection_list = None
selection_list = ["7e370616-7bcf-469f-b9a2-c0da55463939", "c2d385d8-b772-4ecd-be89-8c468738654a"]
selection_list = [
"7e370616-7bcf-469f-b9a2-c0da55463939",
"c2d385d8-b772-4ecd-be89-8c468738654a",
]
# selection_list = None
manager_token = ""
writers_token = manager_token
@@ -109,8 +112,10 @@ if add_with_occupant:
)["data"]["uu_id"]
unit_price = 15.90
run_decision_book_items(
writers_token=writers_token, unit_price=unit_price, is_fixed=is_fixed_price,
info_type_uu_id=info_type_d_uu_id
writers_token=writers_token,
unit_price=unit_price,
is_fixed=is_fixed_price,
info_type_uu_id=info_type_d_uu_id,
)
is_fixed_price = True
@@ -120,8 +125,12 @@ if add_with_occupant:
start_date, end_date = "2024-11-01", "2025-02-01"
unit_price = 850
run_decision_book_items(
writers_token=writers_token, unit_price=unit_price, is_fixed=is_fixed_price,
info_type_uu_id=info_type_a_uu_id, start_date=start_date, end_date=end_date
writers_token=writers_token,
unit_price=unit_price,
is_fixed=is_fixed_price,
info_type_uu_id=info_type_a_uu_id,
start_date=start_date,
end_date=end_date,
)
info_type_a_uu_id = get_type_codes_key_and_class(
@@ -129,8 +138,12 @@ if add_with_occupant:
)["data"]["uu_id"]
unit_price = 5000
run_decision_book_items(
writers_token=writers_token, unit_price=unit_price, is_fixed=is_fixed_price,
info_type_uu_id=info_type_a_uu_id, start_date=start_date, end_date=end_date
writers_token=writers_token,
unit_price=unit_price,
is_fixed=is_fixed_price,
info_type_uu_id=info_type_a_uu_id,
start_date=start_date,
end_date=end_date,
)
info_type_a_uu_id = get_type_codes_key_and_class(
@@ -138,8 +151,12 @@ if add_with_occupant:
)["data"]["uu_id"]
unit_price = 2000
run_decision_book_items(
writers_token=writers_token, unit_price=unit_price, is_fixed=is_fixed_price,
info_type_uu_id=info_type_a_uu_id, start_date=start_date, end_date=end_date
writers_token=writers_token,
unit_price=unit_price,
is_fixed=is_fixed_price,
info_type_uu_id=info_type_a_uu_id,
start_date=start_date,
end_date=end_date,
)
info_type_a_uu_id = get_type_codes_key_and_class(
@@ -147,7 +164,10 @@ if add_with_occupant:
)["data"]["uu_id"]
unit_price = 750
run_decision_book_items(
writers_token=writers_token, unit_price=unit_price, is_fixed=is_fixed_price,
info_type_uu_id=info_type_a_uu_id, start_date=start_date, end_date=end_date
writers_token=writers_token,
unit_price=unit_price,
is_fixed=is_fixed_price,
info_type_uu_id=info_type_a_uu_id,
start_date=start_date,
end_date=end_date,
)