Пример #1
0
 def test(self):
     #    TODO: Change this once we know how Results is implemented.
     r = Results(ns="me")
     tId = 123
     bSynchronous = True
     result = r._handler_package(tId, bSynchronous)
     assert isinstance(result, iApiTransportResponse)
     response = result.response()
     assert isinstance(response, iPackageResult)
Пример #2
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
Пример #3
0
 def testNs(self):
     tests = Results(ns="me")
     eNs = "me.results".lower()
     assert tests._getNamespace() == eNs, "Got: %(NS)s" % {"NS": eNs}