From 038ab404d240a46be095ee33de1016475261db4d Mon Sep 17 00:00:00 2001 From: Leonid Gorbunov Date: Mon, 27 Jan 2025 11:03:34 +0300 Subject: [PATCH] fix: in UserFromSearch field ip_phone, other_ip_phone from str to int --- pybotx/client/users_api/user_from_csv.py | 4 ++-- pybotx/models/users.py | 4 ++-- tests/client/users_api/test_users_as_csv.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pybotx/client/users_api/user_from_csv.py b/pybotx/client/users_api/user_from_csv.py index ba18e976..5ef01b2f 100644 --- a/pybotx/client/users_api/user_from_csv.py +++ b/pybotx/client/users_api/user_from_csv.py @@ -33,8 +33,8 @@ class BotXAPIUserFromCSVResult(VerifiedPayloadBaseModel): description: Optional[str] = Field(alias="Description") phone: Optional[str] = Field(alias="Phone") other_phone: Optional[str] = Field(alias="Other phone") - ip_phone: Optional[str] = Field(alias="IP phone") - other_ip_phone: Optional[str] = Field(alias="Other IP phone") + ip_phone: Optional[int] = Field(alias="IP phone") + other_ip_phone: Optional[int] = Field(alias="Other IP phone") personnel_number: Optional[str] = Field(alias="Personnel number") @validator( diff --git a/pybotx/models/users.py b/pybotx/models/users.py index 373f126c..958f1727 100644 --- a/pybotx/models/users.py +++ b/pybotx/models/users.py @@ -106,6 +106,6 @@ class UserFromCSV: description: Optional[str] = None phone: Optional[str] = None other_phone: Optional[str] = None - ip_phone: Optional[str] = None - other_ip_phone: Optional[str] = None + ip_phone: Optional[int] = None + other_ip_phone: Optional[int] = None personnel_number: Optional[str] = None diff --git a/tests/client/users_api/test_users_as_csv.py b/tests/client/users_api/test_users_as_csv.py index 09768ef9..649349c8 100644 --- a/tests/client/users_api/test_users_as_csv.py +++ b/tests/client/users_api/test_users_as_csv.py @@ -73,7 +73,7 @@ async def test__users_as_csv__succeed( status_code=HTTPStatus.OK, content=( b"HUID,AD Login,Domain,AD E-mail,Name,Sync source,Active,Kind,Company,Department,Position,Manager,Manager HUID,Personnel number,Description,IP phone,Other IP phone,Phone,Other phone,Avatar,Office,Avatar preview\n" - b"dbc8934f-d0d7-4a9e-89df-d45c137a851c,test_user_17,cts.example.com,,test_user_17,ad,false,cts_user,Company,Department,Position,Manager John,13a6909c-bce1-4dbf-8359-efb7ef8e5b34,Some number,Description,Ip_phone,Other_ip_phone,Phone,Other_phone,Avatar,Office,Avatar_preview\n" + b"dbc8934f-d0d7-4a9e-89df-d45c137a851c,test_user_17,cts.example.com,,test_user_17,ad,false,cts_user,Company,Department,Position,Manager John,13a6909c-bce1-4dbf-8359-efb7ef8e5b34,Some number,Description,123,321,Phone,Other_phone,Avatar,Office,Avatar_preview\n" b"13a6909c-bce1-4dbf-8359-efb7ef8e5b34,test_user_18,cts.example.com,,test_user_18,unsupported,true,cts_user,,,,,,,,,,,,,," ), ), @@ -107,8 +107,8 @@ async def test__users_as_csv__succeed( manager="Manager John", manager_huid=UUID("13a6909c-bce1-4dbf-8359-efb7ef8e5b34"), description="Description", - ip_phone="Ip_phone", - other_ip_phone="Other_ip_phone", + ip_phone=123, + other_ip_phone=321, phone="Phone", other_phone="Other_phone", avatar="Avatar",