-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AT-3970] enable pylint for storage, host, and tools (#562)
* fix tools * storage: initial commit * drop live tests * drop function that's not used anymore * remove live tests fixture
- Loading branch information
Showing
8 changed files
with
137 additions
and
295 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "up42-py" | ||
version = "0.37.0a5" | ||
version = "0.37.0a6" | ||
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" | ||
|
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 |
---|---|---|
@@ -1,63 +1,44 @@ | ||
import pytest | ||
|
||
from up42.storage import Storage | ||
from up42 import storage | ||
|
||
from .fixtures_globals import ( | ||
API_HOST, | ||
ASSET_ID, | ||
JSON_ASSET, | ||
JSON_ASSETS, | ||
JSON_ORDER, | ||
JSON_ORDERS, | ||
JSON_STORAGE_STAC, | ||
ORDER_ID, | ||
PYSTAC_MOCK_CLIENT, | ||
) | ||
from . import fixtures_globals as constants | ||
|
||
|
||
@pytest.fixture() | ||
def storage_mock(auth_mock, requests_mock): | ||
# pystac client authentication | ||
url_pystac_client = f"{API_HOST}/v2/assets/stac" | ||
requests_mock.get(url=url_pystac_client, json=PYSTAC_MOCK_CLIENT) | ||
url_pystac_client = f"{constants.API_HOST}/v2/assets/stac" | ||
requests_mock.get(url=url_pystac_client, json=constants.PYSTAC_MOCK_CLIENT) | ||
|
||
# assets | ||
url_storage_assets = f"{API_HOST}/v2/assets" | ||
requests_mock.get(url=url_storage_assets, json=JSON_ASSETS) | ||
url_storage_assets = f"{constants.API_HOST}/v2/assets" | ||
requests_mock.get(url=url_storage_assets, json=constants.JSON_ASSETS) | ||
|
||
# storage stac | ||
url_storage_stac = f"{API_HOST}/v2/assets/stac/search" | ||
requests_mock.post(url=url_storage_stac, json=JSON_STORAGE_STAC) | ||
url_storage_stac = f"{constants.API_HOST}/v2/assets/stac/search" | ||
requests_mock.post(url=url_storage_stac, json=constants.JSON_STORAGE_STAC) | ||
|
||
# asset info | ||
url_asset_info = f"{API_HOST}/v2/assets/{ASSET_ID}/metadata" | ||
requests_mock.get(url=url_asset_info, json=JSON_ASSET) | ||
url_asset_info = f"{constants.API_HOST}/v2/assets/{constants.ASSET_ID}/metadata" | ||
requests_mock.get(url=url_asset_info, json=constants.JSON_ASSET) | ||
|
||
# orders | ||
url_storage_orders = ( | ||
f"{API_HOST}/v2/orders" | ||
f"{constants.API_HOST}/v2/orders" | ||
"?sort=createdAt,desc&workspaceId=workspace_id_123" | ||
"&type=ARCHIVE&tags=project-7&tags=optical&size=50" | ||
) | ||
requests_mock.get(url=url_storage_orders, json=JSON_ORDERS) | ||
requests_mock.get(url=url_storage_orders, json=constants.JSON_ORDERS) | ||
|
||
url_storage_orders_params = ( | ||
f"{API_HOST}/v2/orders" | ||
f"{constants.API_HOST}/v2/orders" | ||
"?sort=createdAt,desc" | ||
"&displayName=Test&type=ARCHIVE&status=FULFILLED&status=PLACED&size=50" | ||
) | ||
requests_mock.get(url=url_storage_orders_params, json=JSON_ORDERS) | ||
requests_mock.get(url=url_storage_orders_params, json=constants.JSON_ORDERS) | ||
|
||
# orders info | ||
url_order_info = f"{API_HOST}/v2/orders/{ORDER_ID}" | ||
requests_mock.get(url=url_order_info, json=JSON_ORDER) | ||
|
||
storage = Storage(auth=auth_mock) | ||
|
||
return storage | ||
|
||
|
||
@pytest.fixture() | ||
def storage_live(auth_live): | ||
storage = Storage(auth=auth_live) | ||
return storage | ||
url_order_info = f"{constants.API_HOST}/v2/orders/{constants.ORDER_ID}" | ||
requests_mock.get(url=url_order_info, json=constants.JSON_ORDER) | ||
return storage.Storage(auth=auth_mock) |
Oops, something went wrong.