'Should by default duplicate the null file to the system stream.'

def test_duplicates_null_file_descriptor_by_default(self):

    system_stream = self.test_system_stream
    system_fileno = system_stream.fileno()
    target_stream = None
    null_path = os.devnull
    null_flag = os.O_RDWR
    null_file = self.test_null_file
    null_fileno = null_file.fileno()
    expect_mock_output = ('                                                Called    os.open(%(null_path)r,    %(null_flag)r)\n                                                Called    os.dup2(%(null_fileno)r,    %(system_fileno)r)\n                                                ' % vars())
    daemon.daemon.redirect_stream(system_stream, target_stream)
    self.failUnlessMockCheckerMatch(expect_mock_output)
