|
1 | | -from typing import Any, Dict |
2 | | -from uuid import UUID |
3 | | - |
4 | | -import pytest |
5 | | - |
6 | | -from pybotx import UserFromSearch, UserKinds |
7 | | -from tests.client.users_api.convert_to_datetime import convert_to_datetime |
8 | | - |
9 | | - |
10 | | -@pytest.fixture() |
11 | | -def user_from_search_with_data_json() -> Dict[str, Any]: |
12 | | - return { |
13 | | - "user_huid": "6fafda2c-6505-57a5-a088-25ea5d1d0364", |
14 | | - "ad_login": "ad_user_login", |
15 | | - "ad_domain": "cts.com", |
16 | | - "name": "Bob", |
17 | | - "company": "Bobs Co", |
18 | | - "company_position": "Director", |
19 | | - "department": "Owners", |
20 | | - "emails": ["ad_user@cts.com"], |
21 | | - "user_kind": "cts_user", |
22 | | - "active": True, |
23 | | - "created_at": "2023-03-26T14:36:08.740618Z", |
24 | | - "cts_id": "e0140f4c-4af2-5a2e-9ad1-5f37fceafbaf", |
25 | | - "description": "Director in Owners dep", |
26 | | - "ip_phone": "1271020", |
27 | | - "manager": "Alice", |
28 | | - "office": "SUN", |
29 | | - "other_ip_phone": "32593", |
30 | | - "other_phone": "1254218", |
31 | | - "public_name": "Bobby", |
32 | | - "rts_id": "f46440a4-d930-58d4-b3f5-8110ab846ee3", |
33 | | - "updated_at": "2023-03-26T14:36:08.740618Z", |
34 | | - } |
35 | | - |
36 | | - |
37 | | -@pytest.fixture |
38 | | -def user_from_search_with_data() -> UserFromSearch: |
39 | | - return UserFromSearch( |
40 | | - huid=UUID("6fafda2c-6505-57a5-a088-25ea5d1d0364"), |
41 | | - ad_login="ad_user_login", |
42 | | - ad_domain="cts.com", |
43 | | - username="Bob", |
44 | | - company="Bobs Co", |
45 | | - company_position="Director", |
46 | | - department="Owners", |
47 | | - emails=["ad_user@cts.com"], |
48 | | - other_id=None, |
49 | | - user_kind=UserKinds.CTS_USER, |
50 | | - active=True, |
51 | | - created_at=convert_to_datetime("2023-03-26T14:36:08.740618Z"), |
52 | | - cts_id=UUID("e0140f4c-4af2-5a2e-9ad1-5f37fceafbaf"), |
53 | | - description="Director in Owners dep", |
54 | | - ip_phone="1271020", |
55 | | - manager="Alice", |
56 | | - office="SUN", |
57 | | - other_ip_phone="32593", |
58 | | - other_phone="1254218", |
59 | | - public_name="Bobby", |
60 | | - rts_id=UUID("f46440a4-d930-58d4-b3f5-8110ab846ee3"), |
61 | | - updated_at=convert_to_datetime("2023-03-26T14:36:08.740618Z"), |
62 | | - ) |
63 | | - |
64 | | - |
65 | | -@pytest.fixture |
66 | | -def user_from_search_without_data_json() -> Dict[str, Any]: |
67 | | - return { |
68 | | - "user_huid": "6fafda2c-6505-57a5-a088-25ea5d1d0364", |
69 | | - "ad_login": "ad_user_login", |
70 | | - "ad_domain": "cts.com", |
71 | | - "name": "Bob", |
72 | | - "company": "Bobs Co", |
73 | | - "company_position": "Director", |
74 | | - "department": "Owners", |
75 | | - "emails": ["ad_user@cts.com"], |
76 | | - "user_kind": "cts_user", |
77 | | - "active": None, |
78 | | - "created_at": None, |
79 | | - "cts_id": None, |
80 | | - "description": None, |
81 | | - "ip_phone": None, |
82 | | - "manager": None, |
83 | | - "office": None, |
84 | | - "other_ip_phone": None, |
85 | | - "other_phone": None, |
86 | | - "public_name": None, |
87 | | - "rts_id": None, |
88 | | - "updated_at": None, |
89 | | - } |
90 | | - |
91 | | - |
92 | | -@pytest.fixture |
93 | | -def user_from_search_without_data() -> UserFromSearch: |
94 | | - return UserFromSearch( |
95 | | - huid=UUID("6fafda2c-6505-57a5-a088-25ea5d1d0364"), |
96 | | - ad_login="ad_user_login", |
97 | | - ad_domain="cts.com", |
98 | | - username="Bob", |
99 | | - company="Bobs Co", |
100 | | - company_position="Director", |
101 | | - department="Owners", |
102 | | - emails=["ad_user@cts.com"], |
103 | | - other_id=None, |
104 | | - user_kind=UserKinds.CTS_USER, |
105 | | - active=None, |
106 | | - created_at=None, |
107 | | - cts_id=None, |
108 | | - description=None, |
109 | | - ip_phone=None, |
110 | | - manager=None, |
111 | | - office=None, |
112 | | - other_ip_phone=None, |
113 | | - other_phone=None, |
114 | | - public_name=None, |
115 | | - rts_id=None, |
116 | | - updated_at=None, |
117 | | - ) |
| 1 | +from tests.fixtures.users_api import ( # noqa: F401 |
| 2 | + user_from_search_with_data, |
| 3 | + user_from_search_with_data_json, |
| 4 | + user_from_search_without_data, |
| 5 | + user_from_search_without_data_json, |
| 6 | +) |
0 commit comments