'Set up test fixtures.'

def setUp(self):

    self.mock_tracker = scaffold.MockTracker()
    self.RLIMIT_NOFILE = object()
    self.RLIM_INFINITY = object()
    self.test_rlimit_nofile = self.RLIM_INFINITY
    def mock_getrlimit(resource):
        result = (self.test_rlimit_nofile, object())
        if (resource != self.RLIMIT_NOFILE):
            result = NotImplemented
        return result
    self.test_maxfd = 8
    scaffold.mock('daemon.daemon.get_maximum_file_descriptors', returns=self.test_maxfd, tracker=self.mock_tracker)
    scaffold.mock('resource.RLIMIT_NOFILE', mock_obj=self.RLIMIT_NOFILE, tracker=self.mock_tracker)
    scaffold.mock('resource.RLIM_INFINITY', mock_obj=self.RLIM_INFINITY, tracker=self.mock_tracker)
    scaffold.mock('resource.getrlimit', returns_func=mock_getrlimit, tracker=self.mock_tracker)
    scaffold.mock('daemon.daemon.close_file_descriptor_if_open', tracker=self.mock_tracker)
