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

[Tech-debt] Clean up global fixtures #695

Merged
merged 3 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ You can check your current version with the following command:
```

For more information, see [UP42 Python package description](https://pypi.org/project/up42-py/).
## 2.1.1a12

**Dec, 3, 2024**
- Move `tests/fixtures/fixtures_globals.py` to `tests/constants.py`.
- Move constants used in a single test module to the corresponding module.

## 2.1.1a11

**Dec, 2, 2024**
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "up42-py"
version = "2.1.1a11"
version = "2.1.1a12"
description = "Python SDK for UP42, the geospatial marketplace and developer platform."
authors = ["UP42 GmbH <[email protected]>"]
license = "https://github.com/up42/up42-py/blob/master/LICENSE"
Expand Down
3 changes: 1 addition & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import pytest
import requests

from tests import constants
from up42 import host

from .fixtures import fixtures_globals as constants


@pytest.fixture(autouse=True)
def restore_default_domain():
Expand Down
58 changes: 58 additions & 0 deletions tests/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
TOKEN = "token_123"
API_HOST = "https://api.up42.com"
WORKSPACE_ID = "workspace_id_123"
USER_EMAIL = "[email protected]"
PASSWORD = "<PASSWORD>"
DATA_PRODUCT_ID = "47dadb27-9532-4552-93a5-48f70a83eaef"
ORDER_ID = "da2310a2-c7fb-42ed-bead-fb49ad862c67"
URL_STAC_CATALOG = f"{API_HOST}/v2/assets/stac/"
URL_STAC_SEARCH = f"{API_HOST}/v2/assets/stac/search"

STAC_CATALOG_RESPONSE = {
"conformsTo": [
"https://api.stacspec.org/v1.0.0-rc.1/item-search#sort",
"https://api.stacspec.org/v1.0.0-rc.1/collections",
"https://api.stacspec.org/v1.0.0-rc.1/item-search#filter",
"http://www.opengis.net/spec/ogcapi-features-4/1.0/conf/simpletx",
"https://api.stacspec.org/v1.0.0-rc.1/item-search#filter:basic-cql",
"https://api.stacspec.org/v1.0.0-rc.1/item-search",
"https://api.stacspec.org/v1.0.0-rc.1/ogcapi-features/extensions/transaction",
"https://api.stacspec.org/v1.0.0-rc.1/item-search#filter:cql-text",
"http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/features-filter",
"http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/filter",
"https://api.stacspec.org/v1.0.0-rc.1/core",
"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core",
"https://api.stacspec.org/v1.0.0-rc.1/ogcapi-features",
"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson",
"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30",
],
"links": [
{
"href": URL_STAC_CATALOG,
"rel": "self",
"type": "application/json",
},
{
"href": URL_STAC_CATALOG,
"rel": "root",
"type": "application/json",
},
{
"href": "https://api.up42.com/v2/assets/stac/collections",
"rel": "data",
"type": "application/json",
},
{
"href": URL_STAC_SEARCH,
"rel": "search",
"type": "application/json",
"method": "POST",
},
],
"stac_extensions": [],
"title": "UP42 Storage",
"description": "UP42 Storage STAC API",
"stac_version": "1.0.0",
"id": "up42-storage",
"type": "Catalog",
}
Empty file removed tests/fixtures/__init__.py
Empty file.
141 changes: 0 additions & 141 deletions tests/fixtures/fixtures_globals.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/http/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from tests.fixtures import fixtures_globals as constants
from tests import constants
from up42.http import client, config

SETTINGS = {"some": "settings"}
Expand Down
Loading