def test_credentials_in_url_auth_flag_has_priority(httpbin_both):
 url = add_auth((httpbin_both.url + '/basic-auth/user/password'), auth='user:wrong')
 r = http('--auth=user:password', 'GET', url)
 assert (HTTP_OK in r)
 assert (r.json == {'authenticated': True, 'user': 'user'})

def test_credentials_in_url_auth_flag_has_priority ( httpbin_both ) : url = add_auth ( ( httpbin_both . url + '/basic-auth/user/password' ) , auth = 'user:wrong' ) r = http ( '--auth=user:password' , 'GET' , url ) assert ( HTTP_OK in r ) assert ( r . json == { 'authenticated' : True , 'user' : 'user' } )
when credentials are passed in url and via -a at the same time .