@@ -320,53 +320,54 @@ def test_retrieve_card_brands(setup):
320320 test_credit_card_account = setup ['test_credit_card_account' ]
321321
322322 card_retrieve_response = method .accounts (test_credit_card_account ['id' ]).card_brands .retrieve (card_brand_create_response ['id' ])
323- expect_results : AccountCardBrand = {
323+
324+ expect_results = {
324325 'id' : card_brand_create_response ['id' ],
325326 'account_id' : test_credit_card_account ['id' ],
326327 'network' : 'visa' ,
327328 'status' : 'completed' ,
328329 'issuer' : card_brand_create_response ['issuer' ],
329330 'last4' : '1580' ,
330- 'brands' : [{
331- 'art_id' : 'art_pCc787cy3ciWp' ,
332- 'id' : 'brand_UBwVzXjpP4PJ6' ,
333- 'name' : 'Chase Sapphire Reserve' ,
334- 'url' : 'https://static.methodfi.com/card_brands/1b7ccaba6535cb837f802d968add4700.png' }],
335331 'shared' : False ,
336332 'source' : "network" ,
337333 'error' : None ,
338334 'created_at' : card_retrieve_response ['created_at' ],
339335 'updated_at' : card_retrieve_response ['updated_at' ],
340336 }
341337
342- assert card_retrieve_response == expect_results
338+ for k , v in expect_results .items ():
339+ assert card_retrieve_response [k ] == v
340+
341+ brand = card_retrieve_response ['brands' ][0 ]
342+ assert brand ['id' ] == 'brand_UBwVzXjpP4PJ6'
343+ assert brand ['name' ] == 'Chase Sapphire Reserve'
344+ assert brand ['url' ] == 'https://static.methodfi.com/card_brands/1b7ccaba6535cb837f802d968add4700.png'
345+ assert isinstance (brand ['art_id' ], str ) and brand ['art_id' ].startswith ('art_' )
343346
344347@pytest .mark .asyncio
345348async def test_list_card_brands (setup ):
346349 test_credit_card_account = setup ['test_credit_card_account' ]
347-
348- card_brands_list_response = method .accounts (test_credit_card_account ['id' ]).card_brands .list ()
349-
350- expect_results : AccountCardBrand = {
351- 'id' : card_brand_create_response ['id' ],
352- 'account_id' : test_credit_card_account ['id' ],
353- 'network' : 'visa' ,
354- 'status' : 'completed' ,
355- 'issuer' : card_brand_create_response ['issuer' ],
356- 'last4' : '1580' ,
357- 'brands' : [{
358- 'art_id' : 'art_pCc787cy3ciWp' ,
359- 'id' : 'brand_UBwVzXjpP4PJ6' ,
360- 'name' : 'Chase Sapphire Reserve' ,
361- 'url' : 'https://static.methodfi.com/card_brands/1b7ccaba6535cb837f802d968add4700.png' }],
362- 'shared' : False ,
363- 'source' : "network" ,
364- 'error' : None ,
365- 'created_at' : card_brands_list_response [0 ]['created_at' ],
366- 'updated_at' : card_brands_list_response [0 ]['updated_at' ],
367- }
368350
369- assert card_brands_list_response [0 ] == expect_results
351+ card_brands_list_response = method .accounts (test_credit_card_account ['id' ]).card_brands .list ()
352+ result = card_brands_list_response [0 ]
353+
354+ assert result ['id' ] == card_brand_create_response ['id' ]
355+ assert result ['account_id' ] == test_credit_card_account ['id' ]
356+ assert result ['network' ] == 'visa'
357+ assert result ['status' ] == 'completed'
358+ assert result ['issuer' ] == card_brand_create_response ['issuer' ]
359+ assert result ['last4' ] == '1580'
360+ assert result ['shared' ] is False
361+ assert result ['source' ] == 'network'
362+ assert result ['error' ] is None
363+ assert result ['created_at' ] == result ['created_at' ]
364+ assert result ['updated_at' ] == result ['updated_at' ]
365+
366+ brand = result ['brands' ][0 ]
367+ assert brand ['id' ] == 'brand_UBwVzXjpP4PJ6'
368+ assert brand ['name' ] == 'Chase Sapphire Reserve'
369+ assert brand ['url' ] == 'https://static.methodfi.com/card_brands/1b7ccaba6535cb837f802d968add4700.png'
370+ assert isinstance (brand ['art_id' ], str ) and brand ['art_id' ].startswith ('art_' )
370371
371372def test_create_payoffs (setup ):
372373 global payoff_create_response
0 commit comments