Skip to content

Conversation

Copy link

Copilot AI commented Jan 5, 2026

The DummyBackend testing utility was located in the private openeo.rest._testing module, preventing users from safely using it in their own tests without relying on internal APIs.

Changes

  • Moved testing utilities to openeo/testing/backend.py

    • DummyBackend class
    • OpeneoTestingException
    • build_capabilities() function
  • Updated openeo/testing/__init__.py to export the public API

  • Converted openeo/rest/_testing.py to a backward compatibility wrapper that imports from the new location

    • Note: OPENEO_BACKEND constant remains in openeo/rest/_testing.py only (not moved to the public API as it's unrelated to DummyBackend)
  • Moved tests to tests/testing/test_backend.py - Relocated DummyBackend tests from tests/rest/test_testing.py to align with the new module structure and updated imports to use the public API

Usage

Users can now import from the public module:

from openeo.testing import DummyBackend, build_capabilities

# Create a mock backend for testing
dummy = DummyBackend.at_url("https://test.example", requests_mock=requests_mock)
dummy.setup_collection("S2")

# Test your code against the mock
cube = dummy.connection.load_collection("S2")
cube.execute()

# Inspect the process graph
pg = dummy.get_sync_pg()

The old import path continues to work for backward compatibility, including access to OPENEO_BACKEND which remains available only from openeo.rest._testing.

Original prompt

This section details on the original issue you should resolve

<issue_title>Move DummyBackend to openeo.testing</issue_title>
<issue_description>this TODO:

class DummyBackend:
"""
Dummy backend that handles sync/batch execution requests
and allows inspection of posted process graphs
"""
# TODO: move to openeo.testing

so users can use this for their own testing in a future proof manner

CC @soxofaan </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 5, 2026 14:06
Co-authored-by: soxofaan <44946+soxofaan@users.noreply.github.com>
Co-authored-by: soxofaan <44946+soxofaan@users.noreply.github.com>
Co-authored-by: soxofaan <44946+soxofaan@users.noreply.github.com>
Copilot AI changed the title [WIP] Move DummyBackend to openeo.testing for user testing Move DummyBackend to public openeo.testing module Jan 5, 2026
Copilot AI requested a review from soxofaan January 5, 2026 14:13
@soxofaan
Copy link
Member

soxofaan commented Jan 5, 2026

@copilot can you also move the DummyBackend tests accordingly?

@soxofaan
Copy link
Member

soxofaan commented Jan 5, 2026

@copilot don't move the OPENEO_BACKEND constant as it is unrelated to DummyBackend

Co-authored-by: soxofaan <44946+soxofaan@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 5, 2026

@copilot can you also move the DummyBackend tests accordingly?

Done! Moved the tests from tests/rest/test_testing.py to tests/testing/test_backend.py and updated the imports to use the new public API (from openeo.testing import DummyBackend). All 7 tests pass in the new location. (1bdee2d)

Co-authored-by: soxofaan <44946+soxofaan@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 5, 2026

@copilot don't move the OPENEO_BACKEND constant as it is unrelated to DummyBackend

Done! Removed OPENEO_BACKEND from openeo.testing and kept it in openeo.rest._testing where it was originally. It's now only available from the old import path for backward compatibility. (1b5ed26)

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.

Move DummyBackend to openeo.testing

2 participants