def test_fix_local_symlinks(deployment_dir): d = Deployment('testing') d.package_dir = deployment_dir local = os.path.join(deployment_dir, 'local') os.makedirs(local) target = os.path.join(deployment_dir, 'sometarget') symlink = os.path.join(local, 'symlink') os.symlink(target, symlink) d.fix_local_symlinks() eq_(os.readlink(symlink), '../sometarget')
def test_fix_local_symlinks_with_relative_links(deployment_dir): # Runs shouldn't ruin the already relative symlinks. d = Deployment('testing') d.package_dir = deployment_dir local = os.path.join(deployment_dir, 'local') os.makedirs(local) symlink = os.path.join(local, 'symlink') os.symlink('../target', symlink) d.fix_local_symlinks() eq_(os.readlink(symlink), '../target')
def test_fix_local_symlinks_with_relative_links(deployment_dir): # Runs shouldn't ruin the already relative symlinks. d = Deployment("testing") d.package_dir = deployment_dir local = os.path.join(deployment_dir, "local") os.makedirs(local) symlink = os.path.join(local, "symlink") os.symlink("../target", symlink) d.fix_local_symlinks() eq_(os.readlink(symlink), "../target")
def test_fix_local_symlinks(deployment_dir): d = Deployment("testing") d.package_dir = deployment_dir local = os.path.join(deployment_dir, "local") os.makedirs(local) target = os.path.join(deployment_dir, "sometarget") symlink = os.path.join(local, "symlink") os.symlink(target, symlink) d.fix_local_symlinks() eq_(os.readlink(symlink), "../sometarget")
def test_fix_local_symlinks_does_not_blow_up_on_missing_local(deployment_dir): d = Deployment('testing') d.package_dir = deployment_dir d.fix_local_symlinks()