Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export_workspace: support remove_original #320

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bossie
Copy link
Collaborator

@bossie bossie commented Oct 17, 2024

tmp_path = PosixPath('/var/lib/jenkins/workspace/enEO_openeo-python-driver_PR-320/pytest-tmp/pytest-of-jenkins/pytest-0/test_disk_workspace_remove_ori1')
remove_original = True

    @pytest.mark.parametrize("remove_original", [False, True])
    def test_disk_workspace_remove_original(tmp_path, remove_original):
        source_directory = tmp_path / "src"
        source_directory.mkdir()
        source_file = source_directory / "file"
        source_file.touch()

        merge = "."
        target_directory = tmp_path / merge

        workspace = DiskWorkspace(root_directory=tmp_path)
>       workspace.import_file(source_file, merge=merge, remove_original=remove_original)

tests/test_workspace.py:43:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
openeo_driver/workspace.py:35: in import_file
    operation(file, target_directory)
/usr/lib64/python3.8/shutil.py:776: in move
    real_dst = os.path.join(dst, _basename(src))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

path = PosixPath('/var/lib/jenkins/workspace/enEO_openeo-python-driver_PR-320/pytest-tmp/pytest-of-jenkins/pytest-0/test_disk_workspace_remove_ori1/src/file')

    def _basename(path):
        # A basename() variant which first strips the trailing slash, if present.
        # Thus we always get the last component of the path, even for directories.
        sep = os.path.sep + (os.path.altsep or '')
>       return os.path.basename(path.rstrip(sep))
E       AttributeError: 'PosixPath' object has no attribute 'rstrip'

/usr/lib64/python3.8/shutil.py:740: AttributeError

Open-EO/openeo-geopyspark-driver#883
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

export_workspace: skip writing to local storage
1 participant