@@ -294,9 +294,33 @@ def test_odata_version_header(sut: SystemUnderTest):
294
294
test_header_value (sut , header , '4.0' , uri , method , response ,
295
295
Assertion .RESP_HEADERS_ODATA_VERSION )
296
296
297
+ def test_www_authenticate_requirement (sut : SystemUnderTest ):
298
+ """Check for HTTPBasicAuth Property"""
299
+ response = sut .get_response ('GET' , sut .account_service_uri )
300
+
301
+ if (response is not None and response .ok ):
302
+ data = response .json ()
303
+ key = 'HTTPBasicAuth'
304
+ if key in data :
305
+ if data [key ] != "Enabled" :
306
+ # could be either Disabled or Unadvertised
307
+ return False
308
+ else :
309
+ return True
310
+ # Any Failure will be considered as HTTPBasicAuth not present
311
+ return True
312
+
297
313
298
314
def test_www_authenticate_header (sut : SystemUnderTest ):
299
315
"""Perform tests for Assertion.RESP_HEADERS_WWW_AUTHENTICATE."""
316
+
317
+ if (False == test_www_authenticate_requirement (sut )):
318
+ msg = ('The WWW-Authenticate header is not tested because value of HTTPBasicAuth '
319
+ 'is either Disabled or Unadvertised ' )
320
+ sut .log (Result .NOT_TESTED , '' , '' , '' ,
321
+ Assertion .RESP_HEADERS_WWW_AUTHENTICATE , msg )
322
+ return
323
+
300
324
# a selection of URis to test
301
325
uris = [sut .sessions_uri , sut .mgr_net_proto_uri , sut .systems_uri ,
302
326
sut .accounts_uri , sut .account_service_uri ,
0 commit comments