'Should request close of all open files but those excluded.'

def test_requests_all_but_excluded_files_to_close(self):

    test_exclude = set([3, 7])
    args = dict(exclude=test_exclude)
    expect_file_descriptors = (fd for fd in reversed(range(self.test_maxfd)) if (fd not in test_exclude))
    expect_mock_output = ('...\n' + ''.join((('Called    daemon.daemon.close_file_descriptor_if_open(%(fd)r)\n' % vars()) for fd in expect_file_descriptors)))
    daemon.daemon.close_all_open_files(**args)
    self.failUnlessMockCheckerMatch(expect_mock_output)
