示例#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
文件: SocketInfo.py 项目: Eo300/DIRAC
 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' ]