Пример #1
0
def test_checkHostsMatch(host1, host2, isValid, expected):
    result = checkHostsMatch(host1, host2)
    if isValid:
        assert result["OK"]
        assert result["Value"] is expected
    else:
        assert not result["OK"]
Пример #2
0
 def __isSameHost(self, hostCN, hostConn):
   """ Guess if it is the same host or not
   """
   hostCN_m = hostCN
   if '/' in hostCN:
     hostCN_m = hostCN.split('/')[1]
   if hostCN_m == hostConn:
     return True
   result = checkHostsMatch(hostCN_m, hostConn)
   if not result['OK']:
     return False
   return result['Value']
Пример #3
0
 def __isSameHost( self, hostCN, hostConn ):
   """ Guess if it is the same host or not
   """
   hostCN_m = hostCN
   if '/' in hostCN:
     hostCN_m = hostCN.split( '/' )[1]
   if hostCN_m == hostConn:
     return True
   result = checkHostsMatch( hostCN_m, hostConn )
   if not result[ 'OK' ]:
     return False
   return result[ 'Value' ]