'Should duplicate file descriptor from target to system stream.'

def test_duplicates_target_file_descriptor(self):

    system_stream = self.test_system_stream
    system_fileno = system_stream.fileno()
    target_stream = self.test_target_stream
    target_fileno = target_stream.fileno()
    expect_mock_output = ('                                                Called    os.dup2(%(target_fileno)r,    %(system_fileno)r)\n                                                ' % vars())
    daemon.daemon.redirect_stream(system_stream, target_stream)
    self.failUnlessMockCheckerMatch(expect_mock_output)
