def setup_daemon_context_fixtures(testcase):
 testcase.mock_tracker = scaffold.MockTracker()
 setup_streams_fixtures(testcase)
 setup_pidfile_fixtures(testcase)
 testcase.mock_pidfile_path = tempfile.mktemp()
 testcase.mock_pidlockfile = scaffold.Mock('pidlockfile.PIDLockFile', tracker=testcase.mock_tracker)
 testcase.mock_pidlockfile.path = testcase.mock_pidfile_path
 scaffold.mock('daemon.daemon.is_detach_process_context_required', returns=True, tracker=testcase.mock_tracker)
 scaffold.mock('daemon.daemon.make_default_signal_map', returns=object(), tracker=testcase.mock_tracker)
 scaffold.mock('os.getuid', returns=object(), tracker=testcase.mock_tracker)
 scaffold.mock('os.getgid', returns=object(), tracker=testcase.mock_tracker)
 testcase.daemon_context_args = dict(stdin=testcase.stream_files_by_name['stdin'], stdout=testcase.stream_files_by_name['stdout'], stderr=testcase.stream_files_by_name['stderr'])
 testcase.test_instance = daemon.DaemonContext(**testcase.daemon_context_args)

def setup_daemon_context_fixtures ( testcase ) : testcase . mock_tracker = scaffold . MockTracker ( ) setup_streams_fixtures ( testcase ) setup_pidfile_fixtures ( testcase ) testcase . mock_pidfile_path = tempfile . mktemp ( ) testcase . mock_pidlockfile = scaffold . Mock ( 'pidlockfile.PIDLockFile' , tracker = testcase . mock_tracker ) testcase . mock_pidlockfile . path = testcase . mock_pidfile_path scaffold . mock ( 'daemon.daemon.is_detach_process_context_required' , returns = True , tracker = testcase . mock_tracker ) scaffold . mock ( 'daemon.daemon.make_default_signal_map' , returns = object ( ) , tracker = testcase . mock_tracker ) scaffold . mock ( 'os.getuid' , returns = object ( ) , tracker = testcase . mock_tracker ) scaffold . mock ( 'os.getgid' , returns = object ( ) , tracker = testcase . mock_tracker ) testcase . daemon_context_args = dict ( stdin = testcase . stream_files_by_name [ 'stdin' ] , stdout = testcase . stream_files_by_name [ 'stdout' ] , stderr = testcase . stream_files_by_name [ 'stderr' ] ) testcase . test_instance = daemon . DaemonContext ( ** testcase . daemon_context_args )
set up common test fixtures for daemoncontext test case .