def test_filePagingWithCallback(self):
        """
        Test L{util.FilePager}, passing a callback to fire when all pages
        are sent, and verify that the pager doesn't keep chunks in memory.
        """
        c, s, pump = connectedServerAndClient(test=self)
        pagerizer = FilePagerizer(self.filename, finishedCallback,
                                  'frodo', value = 9)
        s.setNameForLocal("bar", pagerizer)
        x = c.remoteForName("bar")
        l = []
        util.getAllPages(x, "getPages").addCallback(l.append)
        while not l:
            pump.pump()
        self.assertEqual(b''.join(l[0]), bigString,
                          "Pages received not equal to pages sent!")
        self.assertEqual(callbackArgs, ('frodo',),
                          "Completed callback not invoked")
        self.assertEqual(callbackKeyword, {'value': 9},
                          "Completed callback not invoked")
        self.assertEqual(pagerizer.pager.chunks, [])

        Test L{util.FilePager}, passing a callback to fire when all pages
        are sent, and verify that the pager doesn't keep chunks in memory.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/spread/test/test_pb.py