Beispiel #1
0
 def test_rpyclocalDataInterface(self, dicomTestFilename, bigTestFile):
     # Use a remote (RPC) client to the dataInterface
     TestDataInterface.serversForTests.stopServers()
     TestDataInterface.serversForTests.startServers(allowedDirs=allowedDirs,
                                                    allowedFileTypes=allowedFileTypes,
                                                    dataRemote=False,
                                                    subjectRemote=False)
     clientInterface = ClientInterface()
     dataInterface = clientInterface.dataInterface
     assert clientInterface.isDataRemote() == False
     assert dataInterface.isRemote == False
     runDataInterfaceMethodTests(dataInterface, dicomTestFilename)
     runReadWriteFileTest(dataInterface, bigTestFile)
     return
def runSubjectFeedbackTest(isRemote):
    clientInterface = ClientInterface()
    subjInterface = clientInterface.subjInterface
    print(f'subjInterface remote: {subjInterface.isRemote}, {subjInterface.isRunningRemote()}')
    assert subjInterface.isRunningRemote() == isRemote

    runId = 3
    for trId in range(1, 10):
        value = 20 + trId
        subjInterface.setResult(runId, trId, value)

    for i in range(1, 10):
        feedbackMsg = subjInterface.dequeueResult(block=False, timeout=1)
        assert feedbackMsg['runId'] == runId
        assert feedbackMsg['trId'] == i
        assert feedbackMsg['value'] == 20 + i