@@ -244,9 +244,8 @@ def test_create_etch_packet_valid_payload_type(m_request_post, anvil):
244244 anvil .create_etch_packet (payload = payload )
245245 assert m_request_post .call_count == 1
246246
247- files_payload = json .loads (
248- m_request_post .call_args .kwargs ["files" ]["operations" ][1 ]
249- )
247+ files = m_request_post .call_args [1 ]["files" ]
248+ files_payload = json .loads (files ["operations" ][1 ])
250249 variables = files_payload ["variables" ]
251250 assert expected_data == variables
252251
@@ -264,9 +263,8 @@ def test_create_etch_packet_passes_options(m_request_post, anvil):
264263 anvil .create_etch_packet (payload )
265264
266265 assert m_request_post .call_count == 1
267- files_payload = json .loads (
268- m_request_post .call_args .kwargs ["files" ]["operations" ][1 ]
269- )
266+ files = m_request_post .call_args [1 ]["files" ]
267+ files_payload = json .loads (files ["operations" ][1 ])
270268 variables = files_payload ["variables" ]
271269 assert new_expected == variables
272270
@@ -276,9 +274,8 @@ def test_create_etch_packet_valid_dict_type(m_request_post, anvil):
276274 dict (name = "Packet name" , signature_email_subject = "The subject" )
277275 )
278276 assert m_request_post .call_count == 1
279- files_payload = json .loads (
280- m_request_post .call_args .kwargs ["files" ]["operations" ][1 ]
281- )
277+ files = m_request_post .call_args [1 ]["files" ]
278+ files_payload = json .loads (files ["operations" ][1 ])
282279 variables = files_payload ["variables" ]
283280 assert expected_data == variables
284281
@@ -292,9 +289,8 @@ def test_create_etch_packet_dict_with_signer(
292289 m_create_unique .return_value = "signer-mock-generated"
293290 anvil .create_etch_packet (payload = payloads .ETCH_TEST_PAYLOAD )
294291 assert m_request_post .call_count == 1
295- files_payload = json .loads (
296- m_request_post .call_args .kwargs ["files" ]["operations" ][1 ]
297- )
292+ files = m_request_post .call_args [1 ]["files" ]
293+ files_payload = json .loads (files ["operations" ][1 ])
298294 variables = files_payload ["variables" ]
299295 assert payloads .EXPECTED_ETCH_TEST_PAYLOAD == variables
300296
@@ -313,9 +309,8 @@ def test_create_etch_packet_json(m_request_post, m_create_unique, anvil):
313309 anvil .create_etch_packet (json = json .dumps (payload ))
314310 assert m_request_post .call_count == 1
315311
316- files_payload = json .loads (
317- m_request_post .call_args .kwargs ["files" ]["operations" ][1 ]
318- )
312+ files = m_request_post .call_args [1 ]["files" ]
313+ files_payload = json .loads (files ["operations" ][1 ])
319314 variables = files_payload ["variables" ]
320315 assert payload == variables
321316
@@ -336,9 +331,8 @@ def test_adding_unsupported_fields(m_request_post, m_create_unique, anvil):
336331 anvil .create_etch_packet (payload = cep )
337332 assert m_request_post .call_count == 1
338333
339- files_payload = json .loads (
340- m_request_post .call_args .kwargs ["files" ]["operations" ][1 ]
341- )
334+ files = m_request_post .call_args [1 ]["files" ]
335+ files_payload = json .loads (files ["operations" ][1 ])
342336 variables = files_payload ["variables" ]
343337 assert cep .dict (by_alias = True , exclude_none = True ) == variables
344338 assert "newFeature" in variables
0 commit comments