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

DatasetAPIClient.get_path() method added #76

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

SarahJohnsonONS
Copy link
Contributor

@SarahJohnsonONS SarahJohnsonONS commented Jan 27, 2025

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

What

get_path() method added to DatasetAPIClient, to be able to check that a specified dataset ID exists within the Dataset API and determine whether a POST or PUT request should be submitted.

Testing

Have any new tests been added as part of this issue? If not, try to explain why test coverage is not needed here.

  • Yes
  • No
    Please write a brief description of why test coverage is not necessary here.
  • Not as part of this ticket. (Could be done at a later point)

Documentation

Has any new documentation been written as part of this issue? We should try to keep documentation up to date
as new code is added, rather than leaving it for the future.

  • Yes
  • No
    Please write a brief description of why documentation is not necessary here.
  • Not as part of this ticket. (Could be done at a later point)

Related issues

Ticket link: https://jira.ons.gov.uk/browse/DIS-2423

How to review

Create a DatasetAPIClient using url_netloc="http://localhost:22000/datasets" and url_path="cpih". Check that calling get_path() returns a 200 HTTP status code. Change url_path to a nonsense string, and check that this returns a 404 status code. You'll need to port foward to the Identity API and Dataset API, and set env vars as follows:

os.environ["FLORENCE_USER"] = "<your-email>"
os.environ["FLORENCE_PASSWORD"] = "<your-password>"
os.environ["IDENTITY_API_URL"] = "http://localhost:25600/v1"

emmaons
emmaons previously approved these changes Jan 29, 2025
dpytools/http/base_http.py Outdated Show resolved Hide resolved
tests/http/test_http.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants