def test_cachedRequestClosesFile(self):
    '\n        A GET request that is cached closes the file after the request.\n        '
    (fakeFile, file) = self._makeFilePathWithStringIO()
    request = DummyRequest([''])
    request.method = b'GET'
    request.setLastModified = (lambda _: http.CACHED)
    self.successResultOf(_render(file, request))
    self.assertEqual(b''.join(request.written), b'')
    self.assertTrue(fakeFile.closed)
A GET request that is cached closes the file after the request.
def test_cachedRequestClosesFile(self):
    '\n        \n        '
    (fakeFile, file) = self._makeFilePathWithStringIO()
    request = DummyRequest([])
    request.method = b'GET'
    request.setLastModified = (lambda _: http.CACHED)
    self.successResultOf(_render(file, request))
    self.assertEqual(b.join(request.written), b)
    self.assertTrue(fakeFile.closed)