#NEWLINE# @ patch ( 'requests.Response' ) #NEWLINE# def test_get_http_auth_not_supported( mock ) : #NEWLINE# #INDENT# mock . headers = { #NEWLINE# #INDENT# 'www-authenticate' : 'test' , #NEWLINE# #UNINDENT# } #NEWLINE# mock . url = '' #NEWLINE# with pytest . raises ( DCOSException ) as e : #NEWLINE# #INDENT# http . _get_http_auth ( mock , url = urlparse ( '' ) , auth_scheme = 'foo' ) #NEWLINE# #UNINDENT# msg = "Server responded with an HTTP 'www-authenticate' field of 'test', DCOS only supports 'Basic'" #NEWLINE# assert ( e . exconly ( ) . split ( ':' ) [ 1 ] . strip ( ) == msg )