88
99
1010@pytest .fixture
11- def users (mpt_vendor , account_id ): # noqa: WPS204
11+ def users (mpt_vendor , account_id ):
1212 return mpt_vendor .accounts .accounts .users (account_id = account_id ) # noqa: WPS204
1313
1414
@@ -76,21 +76,23 @@ def created_account_user_group(mpt_vendor, created_account_user, created_user_gr
7676 print (f"TEARDOWN - Unable to delete account user group: { error .title } " ) # noqa: WPS421
7777
7878
79- def test_get_account_user_by_id (mpt_vendor , user_id , account_id ): # noqa: AAA01
79+ def test_get_account_user_by_id (mpt_vendor , user_id , account_id ):
8080 """Test retrieving an account user by ID."""
8181 users_obj = mpt_vendor .accounts .accounts .users (account_id = account_id )
82- account_user = users_obj .get (user_id )
83- assert account_user is not None
8482
83+ result = users_obj .get (user_id )
8584
86- def test_list_account_users (mpt_vendor , account_id ): # noqa: AAA01
85+ assert result is not None
86+
87+
88+ def test_list_account_users (mpt_vendor , account_id ):
8789 """Test listing account users."""
8890 limit = 10
89-
9091 users_obj = mpt_vendor .accounts .accounts .users (account_id = account_id )
91- account_users = users_obj .fetch_page (limit = limit )
9292
93- assert len (account_users ) > 0
93+ result = users_obj .fetch_page (limit = limit )
94+
95+ assert len (result ) > 0
9496
9597
9698def test_get_account_user_by_id_not_found (mpt_vendor , invalid_user_id , account_id ):
@@ -101,31 +103,34 @@ def test_get_account_user_by_id_not_found(mpt_vendor, invalid_user_id, account_i
101103 users_obj .get (invalid_user_id )
102104
103105
104- def test_filter_account_users (mpt_vendor , user_id , account_id ): # noqa: AAA01
106+ def test_filter_account_users (mpt_vendor , user_id , account_id ):
105107 """Test filtering account users."""
106108 select_fields = ["-name" ]
107-
108109 users_obj = mpt_vendor .accounts .accounts .users (account_id = account_id )
109110 filtered_account_users = users_obj .filter (RQLQuery (id = user_id )).select (* select_fields )
110- account_users = list (filtered_account_users .iterate ())
111111
112- assert len ( account_users ) == 1
112+ result = list ( filtered_account_users . iterate ())
113113
114+ assert len (result ) == 1
114115
115- def test_create_account_user (created_account_user ): # noqa: AAA01
116+
117+ def test_create_account_user (created_account_user ):
116118 """Test creating an account user."""
117- account_user_data = created_account_user ()
118- assert account_user_data is not None
119+ result = created_account_user ()
120+
121+ assert result is not None
119122
120123
121- def test_delete_account_user (mpt_vendor , created_account_user , account_id ): # noqa: AAA01
124+ def test_delete_account_user (mpt_vendor , created_account_user , account_id ):
122125 """Test deleting an account user."""
123126 account_user_data = created_account_user ()
124- users_obj = mpt_vendor .accounts .accounts .users (account_id = account_id )
125- users_obj .delete (account_user_data .id )
126127
128+ result = mpt_vendor .accounts .accounts .users (account_id = account_id )
129+
130+ result .delete (account_user_data .id )
127131
128- def test_update_account_user ( # noqa: AAA01
132+
133+ def test_update_account_user (
129134 mpt_vendor ,
130135 account_user_factory ,
131136 created_account_user ,
@@ -138,32 +143,37 @@ def test_update_account_user( # noqa: AAA01
138143 first_name = "E2E Updated" ,
139144 last_name = "Account User" ,
140145 )
141- updated_account_user = users_obj .update (
146+
147+ result = users_obj .update (
142148 account_user_data .id ,
143149 updated_account_user_data ,
144150 )
145- assert updated_account_user is not None
151+
152+ assert result is not None
146153
147154
148- def test_account_user_resend_invite ( # noqa: AAA01
155+ def test_account_user_resend_invite (
149156 mpt_vendor ,
150157 created_account_user ,
151158 account_id ,
152159):
153160 """Test resending an invite to an account user."""
154161 account_user_data = created_account_user ()
155162 users_obj = mpt_vendor .accounts .accounts .users (account_id = account_id )
156- resend_invite = users_obj .resend_invite (account_user_data .id )
157- assert resend_invite is not None
163+
164+ result = users_obj .resend_invite (account_user_data .id )
165+
166+ assert result is not None
158167
159168
160- def test_account_user_group_post (created_account_user_group ): # noqa: AAA01
169+ def test_account_user_group_post (created_account_user_group ):
161170 """Test creating an account user group."""
162- created_account_user_group_data = created_account_user_group
163- assert created_account_user_group_data is not None
171+ result = created_account_user_group
164172
173+ assert result is not None
165174
166- def test_account_user_group_update ( # noqa: AAA01
175+
176+ def test_account_user_group_update (
167177 mpt_vendor ,
168178 created_account_user ,
169179 created_user_group ,
@@ -173,13 +183,15 @@ def test_account_user_group_update( # noqa: AAA01
173183 created_account_user_data = created_account_user ()
174184 users_obj = mpt_vendor .accounts .accounts .users (account_id = account_id )
175185 update_user_group_data = [{"id" : created_user_group .id }]
176- updated_account_user_group = users_obj .groups (user_id = created_account_user_data .id ).update (
186+
187+ result = users_obj .groups (user_id = created_account_user_data .id ).update (
177188 update_user_group_data
178189 )
179- assert updated_account_user_group is not None
180190
191+ assert result is not None
181192
182- def test_account_user_group_delete ( # noqa: AAA01
193+
194+ def test_account_user_group_delete (
183195 mpt_vendor ,
184196 created_account_user ,
185197 created_user_group ,
@@ -190,4 +202,5 @@ def test_account_user_group_delete( # noqa: AAA01
190202 users_obj = mpt_vendor .accounts .accounts .users (account_id = account_id )
191203 create_user_group_data = {"id" : created_user_group .id }
192204 users_obj .groups (user_id = created_account_user_data .id ).create (create_user_group_data )
193- users_obj .groups (user_id = created_account_user_data .id ).delete (created_user_group .id )
205+
206+ users_obj .groups (user_id = created_account_user_data .id ).delete (created_user_group .id ) # act
0 commit comments