# HG changeset patch # User Sebastien Jodogne # Date 1786721489 -7200 # Node ID ee46f818aa6360a4e8c989c9f7aef9fe6fba9e2e # Parent 4b44c9333ccc91fcd1552141bfd313cc01bc5adb clarification diff -r 4b44c9333ccc -r ee46f818aa63 Tests/CheckHttpServerSecurity.py --- a/Tests/CheckHttpServerSecurity.py Fri Aug 14 17:27:17 2026 +0200 +++ b/Tests/CheckHttpServerSecurity.py Fri Aug 14 17:31:29 2026 +0200 @@ -80,55 +80,53 @@ return None # Orthanc has not started -def Assert(b): - if b == None: - raise Exception('Bad result') - if not b: +def Assert(expected, actual): + if expected != actual: raise Exception('Bad result') print('==== TEST 1 ====') -Assert(IsHttpServerSecure({ +Assert(True, IsHttpServerSecure({ 'RemoteAccessAllowed': False, 'RegisteredUsers' : { } })) print('==== TEST 2 ====') -Assert(IsHttpServerSecure({ +Assert(True, IsHttpServerSecure({ 'RemoteAccessAllowed': False, 'AuthenticationEnabled': False, 'RegisteredUsers' : { } })) print('==== TEST 3 ====') -Assert(IsHttpServerSecure({ +Assert(True, IsHttpServerSecure({ 'RemoteAccessAllowed': False, 'AuthenticationEnabled': True, 'RegisteredUsers' : { 'orthanc' : 'orthanc' } })) -print('==== TEST 4 ====') -Assert(IsHttpServerSecure({ +print('==== TEST 4 ====') # Orthanc refuses to start since Orthanc 1.13.0 +Assert(None, IsHttpServerSecure({ 'RemoteAccessAllowed': True - }) == None) + })) print('==== TEST 5 (server application scenario) ====') -Assert(IsHttpServerSecure({ +Assert(False, IsHttpServerSecure({ 'RemoteAccessAllowed': True, 'AuthenticationEnabled': False, - }) == False) + })) print('==== TEST 6 ====') -Assert(IsHttpServerSecure({ +Assert(True, IsHttpServerSecure({ 'RemoteAccessAllowed': True, 'AuthenticationEnabled': True, 'RegisteredUsers' : { 'orthanc' : 'orthanc' } })) -print('==== TEST 7 (Docker scenario) ====') -Assert(IsHttpServerSecure({ +print('==== TEST 7 (Docker scenario) ====') # Orthanc refuses to start since Orthanc 1.13.0 +Assert(None, IsHttpServerSecure({ 'RemoteAccessAllowed': True, 'AuthenticationEnabled': True - }) == None) + })) print('Success!')