Skip to content

Commit

Permalink
test(multi-cpt-input): Add minimal testcases for create_multi_cpt_pay…
Browse files Browse the repository at this point in the history
…load(), using openapi-core lib
  • Loading branch information
Thijs Lukkezen authored and tlukkezen committed Sep 25, 2024
1 parent bc4965d commit 8be2332
Show file tree
Hide file tree
Showing 6 changed files with 5,004 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ keywords = ["API", "PileCore", "CEMS", "CRUX"]
repository = "https://github.com/cemsbv/py-pilecore"

[project.optional-dependencies]
test = ["coveralls", "pytest"]
test = ["coveralls", "pytest", "openapi-core"]
docs = [
"Sphinx==6.1.3",
"sphinx-autodoc-typehints==1.22",
Expand Down
17 changes: 17 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pygef
import pytest
from openapi_core import Config, OpenAPI, V30RequestValidator
from pygef.common import Location
from pygef.cpt import CPTData

Expand Down Expand Up @@ -126,6 +127,11 @@ def cpt() -> CPTData:
return pygef.read_cpt("tests/data/cpt.gef")


@pytest.fixture
def cpt_no_coords() -> CPTData:
return pygef.read_cpt("tests/data/cpt_no_coordinates.GEF")


@pytest.fixture
def mock_cases_multi_cpt_bearing_results_valid_data(
mock_multi_cpt_bearing_response: dict, mock_results_passover: dict
Expand Down Expand Up @@ -217,3 +223,14 @@ def mock_cases_multi_cpt_bearing_results(
return CasesMultiCPTBearingResults(
**mock_cases_multi_cpt_bearing_results_valid_data
)


@pytest.fixture
def pc_openapi() -> OpenAPI:
return OpenAPI.from_file_path(
"tests/openapi/openapi.yaml",
config=Config(
spec_validator_cls=None,
request_validator_cls=V30RequestValidator,
),
)
Loading

0 comments on commit 8be2332

Please sign in to comment.