def test_linkToErrors(self):
        """
        Verify C{linkTo} fails in the following case:
            - the target is in a directory that doesn't exist
            - the target already exists
        """
        self.assertRaises(OSError, self.path.child(b"file1").linkTo,
                          self.path.child(b'nosub').child(b'file1'))
        self.assertRaises(OSError, self.path.child(b"file1").linkTo,
                          self.path.child(b'sub1').child(b'file2'))

        Verify C{linkTo} fails in the following case:
            - the target is in a directory that doesn't exist
            - the target already exists
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_paths.py