def test_pagingWithCallback(self):
        """
        Test L{util.StringPager}, passing a callback to fire when all pages
        are sent.
        """
        c, s, pump = connectedServerAndClient(test=self)
        s.setNameForLocal("foo", Pagerizer(finishedCallback, 'hello', value=10))
        x = c.remoteForName("foo")
        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, ('hello',),
                          "Completed callback not invoked")
        self.assertEqual(callbackKeyword, {'value': 10},
                          "Completed callback not invoked")

        Test L{util.StringPager}, passing a callback to fire when all pages
        are sent.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/spread/test/test_pb.py