Example #1
0
 def testInvalidHead(self, type_=eIpcTransportType.MQUEUE):
     headType = eHeadType.HEAD + "hello.world!"
     assert not eHeadType.isValid(headType)
     try:
         TransportFactory.get(headType, self.transportDetails, self.transportDetails, self.transactionManager, self, self)
     except ApiParamError, e:
         assert e.item == headType
         assert len(e.allowedTypes) == 1
         assert eHeadType in e.allowedTypes
Example #2
0
 def _get(e_head_type, i_transport_details, *args, **kwargs):
     e_ipc_transport_type = i_transport_details.getType()
     if not eIpcTransportType.isValid(e_ipc_transport_type):
         raise ApiParamError(e_ipc_transport_type, eIpcTransportType)
     if not eHeadType.isValid(e_head_type):
         raise ApiParamError(e_head_type, eHeadType)
     if e_ipc_transport_type == eIpcTransportType.MQUEUE:
         if e_head_type == eHeadType.HEAD:
             return HeadQueueTransporter(i_transport_details, *args, **kwargs)
         return QueueTransporter(i_transport_details, *args, **kwargs)