'Should ignore OSError EBADF when closing.'

def test_ignores_badfd_error_on_close(self):

    fd = self.test_fd
    test_error = OSError(errno.EBADF, 'Bad    file    descriptor')
    def os_close(fd):
        raise test_error
    os.close.mock_returns_func = os_close
    expect_mock_output = ('                                                Called    os.close(%(fd)r)\n                                                ' % vars())
    daemon.daemon.close_file_descriptor_if_open(fd)
    self.failUnlessMockCheckerMatch(expect_mock_output)
