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

fix(api): correct API endpoints and CLI tools #1726

Merged

Conversation

laurent-laporte-pro
Copy link
Contributor

@laurent-laporte-pro laurent-laporte-pro commented Sep 4, 2023

This PR includes updates to the API endpoints and CLI tools as per the provided change log.

Summary

  • Updated the construction of UploadFile objects in unit tests to accommodate changes in Starlette's API (>= 0.24).
  • Updated stream file download tests for compatibility with both Requests and Httpx.
  • Prepared for migration from Requests to httpx by adjusting imports and usage in LDAP, command line tools, and GUI code.
  • Corrected and updated integration tests for Starlette >= 0.21, which introduced changes to the TestClient implementation.
  • Corrected unit tests for Xpansion-related endpoints to use io.BytesIO for file uploads instead of io.StringIO.
  • Corrected the response model for the update_area_ui endpoint to return None.
  • Corrected JSON payloads for endpoints related to "table mode" to properly convert enumerated values into strings.
  • Corrected the endpoint for HTTPStatus.NO_CONTENT (204) and updated the response model to None.

Related Issues

Fixes #1724

@laurent-laporte-pro laurent-laporte-pro self-assigned this Sep 4, 2023
@laurent-laporte-pro laurent-laporte-pro linked an issue Sep 4, 2023 that may be closed by this pull request
@commit-lint
Copy link

commit-lint bot commented Sep 4, 2023

Bug Fixes

  • api: Correct endpoint for HTTPStatus.NO_CONTENT (204) (b70bc97)
  • api: correct update_area_ui endpoint response model (963f5ee)

Tests

  • api: correct JSON payloads for "table mode" (41b2cc8)
  • api: correct unit tests for Xpansion-related endpoints to use bytes for file upload (7936312)
  • api: update integration tests for Starlette 0.21.0 (ec3c7b7)
  • api: update stream file download tests for compatibility with Requests and Httpx (ce6bdc5)
  • api: update UploadFile object construction for Starlette >= 0.24 (d9c5152)

Code Refactoring

  • tools: prepare for migration from Requests to httpx (f494188)

Continuous Integration

  • change the configuration of mypy to ignore httpx package (6eab8ac)

Contributors

laurent-laporte-pro

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

@laurent-laporte-pro laurent-laporte-pro force-pushed the bugfix/1724-correct-api-endpoints-and-cli-tools branch 2 times, most recently from 23d4585 to fa551c6 Compare September 4, 2023 17:46
@laurent-laporte-pro laurent-laporte-pro requested review from hdinia and removed request for hdinia September 6, 2023 06:37
The response model has been updated to `None`.
Corrects the JSON payloads for endpoints related to the "table mode" to properly convert enumerated values into strings.
The `update_area_ui` endpoint returns `None`.
…ytes for file upload

Correct the unit tests for Xpansion-related endpoints to use `io.BytesIO` instead of `io.StringIO` for sending a file in multipart.
Starlette 0.21.0 introduced changes to the `TestClient` implementation by replacing the `requests` library with `httpx`. This commit corrects and updates unit tests in the `integration` directory to accommodate the new API and resolve breaking changes.
This commit prepares for migrating from Requests to httpx by adjusting imports and usage in LDAP, command line tools, and GUI code.
… 0.24

Adjusted the construction of `UploadFile` objects in unit tests (changes in Starlette's API): the 'content_type' parameter has been removed.
@laurent-laporte-pro laurent-laporte-pro force-pushed the bugfix/1724-correct-api-endpoints-and-cli-tools branch from fa551c6 to 6eab8ac Compare September 6, 2023 09:56
@laurent-laporte-pro laurent-laporte-pro merged commit 5469893 into dev Sep 6, 2023
@laurent-laporte-pro laurent-laporte-pro deleted the bugfix/1724-correct-api-endpoints-and-cli-tools branch September 6, 2023 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade version of FastAPI and Pydantic
3 participants