def METHOD_NAME(self):
    with open(self.source, 'w') as f:
        f.write('some content')
    # Check first that copy_file() will not fall back on copying the file
    # instead of creating the hard link.
    try:
        os.link(self.source, self.target)
    except OSError as e:
        self.skipTest('os.link: %s' % e)
    else:
        unlink(self.target)
    st = os.stat(self.source)
    copy_file(self.source, self.target, link='hard')
    st2 = os.stat(self.source)
    st3 = os.stat(self.target)
    self.assertTrue(os.path.samestat(st, st2), (st, st2))
    self.assertTrue(os.path.samestat(st2, st3), (st2, st3))
    with open(self.source, 'r') as f:
        self.assertEqual(f.read(), 'some content')