'If the connection is closed before the number of bytes indicated by
I{Content-Length} have been received, the L{Deferred} returned by
L{downloadPage} fails with L{PartialDownloadError}.'

def test_downloadPageBrokenDownload(self):

    path = FilePath(self.mktemp())
    d = client.downloadPage(self.getURL('broken'), path.path)
    d = self.assertFailure(d, client.PartialDownloadError)
    def checkResponse(response):
        '\n                                                The    HTTP    status    code    from    the    server    is    propagated    through    the\n                                                C{PartialDownloadError}.\n                                                '
        self.assertEqual(response.status, '200')
        self.assertEqual(response.message, 'OK')
        return response
    d.addCallback(checkResponse)
    def cbFailed(ignored):
        self.assertEqual(path.getContent(), 'abc')
    d.addCallback(cbFailed)
    return d
