Пример #1
0
 def setUp(self):
     TestBase.setUp(self)
     self.stoppers = []
     self.receiverNexus = sigma.Nexus(self.service, receiver,
                                      sigma.BaseNexusUI(self.mktemp()),
                                      self.service.callLater)
     self.stoppers.append(self.receiverNexus)
Пример #2
0
    def testOneSenderManyRecipients(self):
        raddresses = [
            Q2QAddress("receiving-data.org", "receiver%d" % (x, ))
            for x in range(10)
        ]

        nexi = [
            sigma.Nexus(self.service, radr, sigma.BaseNexusUI(self.mktemp()),
                        self.service.callLater) for radr in raddresses
        ]

        self.stoppers.extend(nexi)

        self.senderNexus.push(self.sfile, 'TESTtoTEST', raddresses)
        self.service.flush()

        receivedIntroductions = 0

        for nexium in nexi:
            receivedIntroductions += nexium.ui.receivedIntroductions
        self.failUnless(receivedIntroductions > 1)

        for nexium in nexi:
            peerFiles = childrenOf(nexium.ui.basepath)
            self.assertEquals(len(peerFiles), 1)
            rfiles = childrenOf(peerFiles[0])
            self.assertEquals(len(rfiles), 1, rfiles)
            rfile = rfiles[0]
            self.assertEquals(rfile.open().read(), TEST_DATA,
                              "file value mismatch")
Пример #3
0
    def setUp(self):
        self.realChunkSize = sigma.CHUNK_SIZE
        sigma.CHUNK_SIZE = 100
        svc = self.service = FakeQ2QService()
        fname = self.mktemp()

        sf = self.sfile = FilePath(fname)
        if not sf.parent().isdir():
            sf.parent().makedirs()
        sf.open('w').write(TEST_DATA)
        self.senderNexus = sigma.Nexus(svc, sender,
                                       sigma.BaseNexusUI(self.mktemp()),
                                       svc.callLater)