'Test L{util.StringPager}, passing a callback to fire when all pages
are sent.'

def test_pagingWithCallback(self):

    (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(''.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')
