#NEWLINE# def test_list_tables_failure( ) : #NEWLINE# #INDENT# td = api . API ( 'APIKEY' ) #NEWLINE# td . get = mock . MagicMock ( return_value = make_response ( 500 , b'error' ) ) #NEWLINE# with pytest . raises ( api . APIError ) as error : #NEWLINE# #INDENT# td . list_tables ( 'sample_datasets' ) #NEWLINE# #UNINDENT# assert ( error . value . args == ( '500: List tables failed: error' , ) )