Skip to content

Commit

Permalink
Merge branch 'pytest' of https://github.com/iwphonedo/opal into pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
iwphonedo committed Dec 30, 2024
2 parents b80572c + 7011211 commit 0b42ae0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def publish_data_user_location(src, user, opal_server: OpalServerContainer):
"""Publish user location data to OPAL."""
# Construct the command to publish data update
publish_data_user_location_command = (
f"opal-client publish-data-update --src-url {src} "
f"opal-client publish-data-update --server-url http://localhost:{opal_server.settings.port} --src-url {src} "
f"-t policy_data --dst-path /users/{user}/location {opal_server.obtain_OPAL_tokens()['datasource']}"
)
logger.info(publish_data_user_location_command)
Expand All @@ -163,11 +163,14 @@ def publish_data_user_location(src, user, opal_server: OpalServerContainer):
# Execute the command
result = subprocess.run(publish_data_user_location_command, shell=True)


input("press enter to continue!")
# Check command execution result
if result.returncode != 0:
logger.error("Error: Failed to update user location!")
else:
logger.info(f"Successfully updated user location with source: {src}")
input("press enter to continue!")


def test_user_location(opal_server: list[OpalServerContainer], opal_client: list[OpalClientContainer]):
Expand Down

0 comments on commit 0b42ae0

Please sign in to comment.