Skip to content

Commit

Permalink
fixup! fixup! fixup! Issue #332 introduce support for job listing pag…
Browse files Browse the repository at this point in the history
…ination
  • Loading branch information
soxofaan committed Dec 3, 2024
1 parent a02d0c5 commit 850bae1
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 39 deletions.
61 changes: 35 additions & 26 deletions openeo_driver/dummy/dummy_backend.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
import importlib.metadata
import json
import numbers
import unittest.mock
from datetime import datetime
from functools import lru_cache
from pathlib import Path
from typing import List, Dict, Union, Tuple, Optional, Iterable, Any, Sequence
import unittest.mock
from typing import Any, Dict, Iterable, List, Optional, Sequence, Tuple, Union
from unittest.mock import Mock
import importlib.metadata

import flask
import numpy
import xarray
from shapely.geometry import Polygon, MultiPolygon
from shapely.geometry.base import BaseGeometry, BaseMultipartGeometry
from shapely.geometry.collection import GeometryCollection
import openeo.udf
import werkzeug.datastructures

import xarray
from openeo.api.logs import normalize_log_level
from openeo.internal.process_graph_visitor import ProcessGraphVisitor
from openeo.metadata import CollectionMetadata, Band, SpatialDimension, TemporalDimension, BandDimension
import openeo.udf
from openeo.metadata import (
Band,
BandDimension,
CollectionMetadata,
SpatialDimension,
TemporalDimension,
)
from openeo.util import rfc3339
from openeo_driver.ProcessGraphDeserializer import ConcreteProcessing
from shapely.geometry import MultiPolygon, Polygon
from shapely.geometry.base import BaseGeometry, BaseMultipartGeometry
from shapely.geometry.collection import GeometryCollection

import openeo_driver.util.changelog
from openeo_driver.backend import (
SecondaryServices,
OpenEoBackendImplementation,
CollectionCatalog,
ServiceMetadata,
BatchJobs,
BatchJobMetadata,
BatchJobResultMetadata,
BatchJobs,
CollectionCatalog,
JobListing,
LoadParameters,
OidcProvider,
OpenEoBackendImplementation,
Processing,
SecondaryServices,
ServiceMetadata,
UserDefinedProcesses,
UserDefinedProcessMetadata,
LoadParameters,
Processing,
BatchJobResultMetadata,
JobListing,
)
from openeo_driver.config import OpenEoBackendConfig
from openeo_driver.constants import STAC_EXTENSION
Expand All @@ -44,18 +50,21 @@
from openeo_driver.delayed_vector import DelayedVector
from openeo_driver.dry_run import SourceConstraint
from openeo_driver.errors import (
JobNotFoundException,
FeatureUnsupportedException,
JobNotFinishedException,
ProcessGraphNotFoundException,
JobNotFoundException,
PermissionsInsufficientException,
FeatureUnsupportedException,
ProcessGraphNotFoundException,
)
from openeo_driver.jobregistry import JOB_STATUS
from openeo_driver.save_result import AggregatePolygonResult, AggregatePolygonSpatialResult
from openeo_driver.ProcessGraphDeserializer import ConcreteProcessing
from openeo_driver.save_result import (
AggregatePolygonResult,
AggregatePolygonSpatialResult,
)
from openeo_driver.users import User
import openeo_driver.util.changelog
from openeo_driver.util.http import UrlSafeStructCodec
from openeo_driver.utils import EvalEnv, generate_unique_id, WhiteListEvalEnv
from openeo_driver.utils import EvalEnv, WhiteListEvalEnv, generate_unique_id

DEFAULT_DATETIME = datetime(2020, 4, 23, 16, 20, 27)

Expand Down
43 changes: 30 additions & 13 deletions tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import dirty_equals
import json
import logging
import re
Expand All @@ -10,43 +9,61 @@
from unittest import mock

import boto3
import dirty_equals
import flask
import geopandas as gpd
import moto
import pystac.validation.stac_validator
import pytest
import re_assert
import werkzeug.exceptions
import moto
import geopandas as gpd

from openeo.capabilities import ComparableVersion
from openeo_driver.ProcessGraphDeserializer import custom_process_from_process_graph

from openeo_driver.backend import (
BatchJobMetadata,
UserDefinedProcessMetadata,
BatchJobResultMetadata,
BatchJobs,
OpenEoBackendImplementation,
Processing,
UserDefinedProcessMetadata,
not_implemented,
BatchJobResultMetadata,
)
from openeo_driver.config import OpenEoBackendConfig
from openeo_driver.datacube import DriverVectorCube
from openeo_driver.dummy import dummy_backend, dummy_config
from openeo_driver.dummy.dummy_backend import DummyBackendImplementation
from openeo_driver.errors import OpenEOApiException
from openeo_driver.ProcessGraphDeserializer import custom_process_from_process_graph
from openeo_driver.save_result import VectorCubeResult
from openeo_driver.testing import ApiTester, TEST_USER, ApiResponse, TEST_USER_AUTH_HEADER, \
generate_unique_test_process_id, build_basic_http_auth_header, ListSubSet, DictSubSet, RegexMatcher
from openeo_driver.testing import (
TEST_USER,
TEST_USER_AUTH_HEADER,
ApiResponse,
ApiTester,
DictSubSet,
ListSubSet,
RegexMatcher,
build_basic_http_auth_header,
generate_unique_test_process_id,
)
from openeo_driver.urlsigning import UrlSigner
from openeo_driver.users import User
from openeo_driver.users.auth import HttpAuthHandler, AccessTokenException
from openeo_driver.users.auth import AccessTokenException, HttpAuthHandler
from openeo_driver.users.oidc import OidcProvider
from openeo_driver.util.logging import LOGGING_CONTEXT_FLASK, FlaskRequestCorrelationIdLogging
from openeo_driver.views import EndpointRegistry, _normalize_collection_metadata, build_app, STREAM_CHUNK_SIZE_DEFAULT
from openeo_driver.util.logging import (
LOGGING_CONTEXT_FLASK,
FlaskRequestCorrelationIdLogging,
)
from openeo_driver.views import (
STREAM_CHUNK_SIZE_DEFAULT,
EndpointRegistry,
_normalize_collection_metadata,
build_app,
)

from .conftest import TEST_APP_CONFIG, enhanced_logging
from .data import TEST_DATA_ROOT, get_path


EXPECTED_PROCESSING_EXPRESSION = {"expression": {"process_graph": {"foo": {"process_id": "foo", "arguments": {}}}}, "format": "openeo"}


Expand Down

0 comments on commit 850bae1

Please sign in to comment.