Beispiel #1
0
 def test(self):
     #    TODO: Change this once we know how Results is implemented.
     r = Results(ns="me")
     tId = 123
     bSynchronous = True
     peerIds = [APeer(123), APeer(456), APeer(789)]
     result = r._handler_peerResult(tId, bSynchronous, peerIds)
     assert isinstance(result, iApiTransportResponse)
     response = result.response()
     assert isinstance(response, dict)
     assert len(response.keys()) == len(peerIds)
     for aTestId, aTestResult in response.items():
         assert isinstance(aTestResult, iATestResult)
         pId = aTestId.peerId()
         found = None
         for i in peerIds:
             if i.peerId() == pId:
                 found = i
                 break
         assert found, "Unrequested testId returned!"
         assert isinstance(aTestResult, iATestResult)
         assert aTestResult.testId() == aTestId