'Should perform daemonisation steps in expected sequence.'

def test_performs_steps_in_expected_sequence(self):

    instance = self.test_instance
    instance.chroot_directory = object()
    instance.detach_process = True
    instance.pidfile = self.mock_pidlockfile
    expect_mock_output = ('                                                Called    daemon.daemon.change_root_directory(...)\n                                                Called    daemon.daemon.prevent_core_dump()\n                                                Called    daemon.daemon.change_file_creation_mask(...)\n                                                Called    daemon.daemon.change_working_directory(...)\n                                                Called    daemon.daemon.change_process_owner(...)\n                                                Called    daemon.daemon.detach_process_context()\n                                                Called    daemon.daemon.DaemonContext._make_signal_handler_map()\n                                                Called    daemon.daemon.set_signal_handlers(...)\n                                                Called    daemon.daemon.DaemonContext._get_exclude_file_descriptors()\n                                                Called    daemon.daemon.close_all_open_files(...)\n                                                Called    daemon.daemon.redirect_stream(...)\n                                                Called    daemon.daemon.redirect_stream(...)\n                                                Called    daemon.daemon.redirect_stream(...)\n                                                Called    pidlockfile.PIDLockFile.__enter__()\n                                                Called    daemon.daemon.register_atexit_function(...)\n                                                ' % vars())
    self.mock_tracker.clear()
    instance.open()
    self.failUnlessMockCheckerMatch(expect_mock_output)
