File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -107,18 +107,19 @@ def test_splunk_version(self):
107107 with self .fake_splunk_version (version ):
108108 self .assertEqual (version , self .service .splunk_version )
109109
110- def test_query_without_login (self ):
110+ def test_query_without_login_raises_auth_error (self ):
111111 service = self ._create_unauthenticated_service ()
112-
113- # Ensure raises AuthenticationError
114112 self .assertRaises (AuthenticationError , lambda : service .indexes .list ())
115-
116- # Ensure raises HTTPError 401
113+
114+ # This behavior is needed for backward compatibility for code
115+ # prior to the introduction of AuthenticationError
116+ def test_query_without_login_raises_http_401 (self ):
117+ service = self ._create_unauthenticated_service ()
117118 try :
118119 service .indexes .list ()
119120 self .fail ('Expected HTTP 401.' )
120121 except HTTPError as he :
121- if he .code == 401 :
122+ if he .status == 401 :
122123 # Good
123124 pass
124125 else :
You can’t perform that action at this time.
0 commit comments