def test_HEADClosesFile(self):
    '\n        A HEAD request opens the file, gets the size, and then closes it after\n        the request.\n        '
    (fakeFile, file) = self._makeFilePathWithStringIO()
    request = DummyRequest([''])
    request.method = b'HEAD'
    self.successResultOf(_render(file, request))
    self.assertEqual(b''.join(request.written), b'')
    self.assertTrue(fakeFile.closed)
A HEAD request opens the file, gets the size, and then closes it after
the request.
def test_HEADClosesFile(self):
    '\n        A HEAD request opens the file, gets the size, and then closes it after\n        the request.\n        '
    (fakeFile, file) = self._makeFilePathWithStringIO()
    request = DummyRequest([])
    request.method = b'HEAD'
    self.successResultOf(_render(file, request))
    self.assertEqual(b.join(request.written), b)
    self.assertTrue(fakeFile.closed)