-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90273d2
commit 10ac34a
Showing
10 changed files
with
462 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,9 +39,6 @@ jobs: | |
- name: Install | ||
run: make install | ||
|
||
- name: Build | ||
run: make build | ||
|
||
- name: Tests | ||
run: make tests | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ description = "Lightweight Python client to interact with GeoServer Cloud REST A | |
authors = ["Camptocamp <[email protected]>"] | ||
license = "BSD-2-Clause" | ||
readme = "README.md" | ||
packages = [{include = "geoservercloud"}] | ||
packages = [{ include = "geoservercloud" }] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.9,<4.0" | ||
|
@@ -15,12 +15,14 @@ xmltodict = "0.13.0" | |
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = "8.3.2" | ||
responses = "0.25.3" | ||
coverage = "7.6.1" | ||
|
||
[build-system] | ||
requires = [ | ||
"poetry-core>=1.0.0", | ||
"poetry-dynamic-versioning[plugin]", | ||
"poetry-plugin-tweak-dependencies-version" | ||
"poetry-plugin-tweak-dependencies-version", | ||
] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import pytest | ||
|
||
from geoservercloud import GeoServerCloud | ||
|
||
GEOSERVER_URL = "http://localhost:8080/geoserver" | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def geoserver(): | ||
geoserver = GeoServerCloud(url=GEOSERVER_URL) | ||
yield geoserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
from typing import Any | ||
|
||
import pytest | ||
import responses | ||
|
||
from geoservercloud.geoservercloud import GeoServerCloud | ||
|
||
WORKSPACE = "test_workspace" | ||
STORE = "test_wmtsstore" | ||
CAPABILITIES_URL = "http://wms?request=GetCapabilities&service=WMS" | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def wmts_store_payload() -> dict[str, dict[str, Any]]: | ||
return { | ||
"wmtsStore": { | ||
"name": STORE, | ||
"type": "WMTS", | ||
"capabilitiesURL": CAPABILITIES_URL, | ||
"workspace": {"name": WORKSPACE}, | ||
"enabled": True, | ||
"metadata": {"entry": {"@key": "useConnectionPooling", "text": True}}, | ||
} | ||
} | ||
|
||
|
||
def test_create_wmts_store( | ||
geoserver: GeoServerCloud, wmts_store_payload: dict[str, dict[str, Any]] | ||
) -> None: | ||
with responses.RequestsMock() as rsps: | ||
rsps.get( | ||
f"{geoserver.url}/rest/workspaces/{WORKSPACE}/wmtsstores/{STORE}.json", | ||
status=404, | ||
) | ||
rsps.post( | ||
f"{geoserver.url}/rest/workspaces/{WORKSPACE}/wmtsstores.json", | ||
json=wmts_store_payload, | ||
status=201, | ||
) | ||
response = geoserver.create_wmts_store( | ||
workspace=WORKSPACE, | ||
name=STORE, | ||
capabilities=CAPABILITIES_URL, | ||
) | ||
assert response | ||
assert response.status_code == 201 | ||
|
||
|
||
def test_update_wmts_store( | ||
geoserver: GeoServerCloud, wmts_store_payload: dict[str, dict[str, Any]] | ||
) -> None: | ||
with responses.RequestsMock() as rsps: | ||
rsps.get( | ||
f"{geoserver.url}/rest/workspaces/{WORKSPACE}/wmtsstores/{STORE}.json", | ||
status=200, | ||
) | ||
rsps.put( | ||
f"{geoserver.url}/rest/workspaces/{WORKSPACE}/wmtsstores/{STORE}.json", | ||
json=wmts_store_payload, | ||
status=200, | ||
) | ||
response = geoserver.create_wmts_store( | ||
workspace=WORKSPACE, | ||
name=STORE, | ||
capabilities=CAPABILITIES_URL, | ||
) | ||
assert response | ||
assert response.status_code == 200 |
Oops, something went wrong.