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

App pack build service integration #31

Merged
merged 5 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,8 @@ cython_debug/
reports/
**/__pycache__
.env


#unity-py
libs/unity-py/tests/test_files/tmp/
libs/unity-py/tests/test_files/tmp2/
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
args:
- --allow-missing-credentials
- id: check-toml # Checks toml files for parsable syntax.

# unity-py markdown lint
# Ignored because it caused exceptions with no clear indication as to the problem
#- repo: https://github.com/igorshubovych/markdownlint-cli
# rev: "v0.39.0"
Expand Down
22 changes: 16 additions & 6 deletions libs/unity-py/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.0] - 2024-08-13
### Added
* Added app-pacakge build system client and integrations
### Fixed
### Changed
### Removed
### Security
### Deprecated


## [0.5.0] - 2024-07-31
### Added
### Fixed
Expand Down Expand Up @@ -58,10 +68,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated


## [0.2.2] - 2024-01-03
## [0.2.2] - 2024-01-03
### Added
* Added project/venue support [5](https://github.com/unity-sds/unity-py/issues/58)
### Fixed
### Fixed
### Changed
### Removed
### Security
Expand All @@ -70,7 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.2.1] - 2023-11-29
### Added
* python code coverage via coveralls
### Fixed
### Fixed
### Changed
* updated install to support python 3.8 and above.
### Removed
Expand All @@ -80,7 +90,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.2.1] - 2023-11-29
### Added
* python code coverage via coveralls
### Fixed
### Fixed
### Changed
* updated install to support python 3.8 and above.
### Removed
Expand All @@ -90,9 +100,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.2.0] - 2023-08-10
### Added
* Added parsing of collection in stac items
* Added parsing of collection in stac items
### Fixed
* fixed release workflow to test against `unity-sds-client` not `unity_py`
* fixed release workflow to test against `unity-sds-client` not `unity_py`
### Changed
* updated package name so that imports reference `unity_sds_client` not `unity_py`
### Removed
Expand Down
375 changes: 209 additions & 166 deletions libs/unity-py/poetry.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion libs/unity-py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "unity-sds-client"
version = "0.5.1"
version = "0.6.0"
description = "Unity-Py is a Python client to simplify interactions with NASA's Unity Platform."
authors = ["Anil Natha, Mike Gangl"]
readme = "README.md"
Expand All @@ -22,6 +22,7 @@ giturlparse = "^0.10.0"
pystac = "^1.7.3"
unity-sps-ogc-processes-api-python-client = "^1.0.0"
#unity-sps-ogc-processes-api-python-client = {path = "../unity-sps-ogc-processes-api-client-python", develop = true}
unity-sds-apgs-client = {path = "../app-package-build-client", develop = true}
jsonschema = "^4.22.0"


Expand Down
35 changes: 35 additions & 0 deletions libs/unity-py/tests/test_unity_application_services.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import pytest
from unity_sds_client.unity import Unity
from unity_sds_client.unity_exception import UnityException
from unity_sds_client.unity_services import UnityServices as Services


@pytest.fixture
def cleanup_update_test():
yield None
print("Cleanup...")


def test_app_package_build(mocker):
mocker.patch(
"unity_sds_apgs_client.api.DefaultApi.ads_acb_mcp_clone_get",
return_value={"clone_url": 123, "log": "abc"},
)
session = Unity()
app_service = session.client(Services.APPLICATION_SERVICE)
response = app_service.build_application_package("my_url")
assert response["clone_url"] == 123


def test_app_package_build_exception(mocker):
mocker.patch(
"unity_sds_apgs_client.api.DefaultApi.ads_acb_mcp_clone_get",
side_effect=Exception("Service Not Found"),
)
session = Unity()
app_service = session.client(Services.APPLICATION_SERVICE)
try:
app_service.build_application_package("my_url")
assert False
except UnityException:
assert True
Loading
Loading