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

Test coverage for projects mapping endpoints #1624

Merged

Conversation

azharcodeit
Copy link
Collaborator

@azharcodeit azharcodeit commented Jul 3, 2024

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

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Related Issue

Partially closes Issue #1614

Describe this PR

This PR covers with tests following endpoints:

  • POST projects/{project_id}/entity/status
  • GET projects/{project_id}/entity/status
  • GET projects/{project_id}/entities/statuses

It verifies that the endpoint correctly returns the entities' mapping statuses by comparing the response data with expected entities data.

To retrieve entities odk_project and entities fixtures have been created.
odk_project extends project fixture by generating project files through project_crud methods.

Screenshots

Screenshot 2024-07-09 at 12 43 24

Alternative Approaches Considered

Did you attempt any other approaches that are not documented in code?

Review Guide

Command to run all tests defined in the project using pytest:

docker compose run --rm api pytest

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

Copy link
Member

@spwoodcock spwoodcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment

src/backend/tests/test_projects_routes.py Outdated Show resolved Hide resolved
@azharcodeit azharcodeit force-pushed the feat/test_project_entities_statuses branch from 443cbfd to 538e607 Compare July 9, 2024 11:40
@azharcodeit azharcodeit changed the title Test for GET ODK entities mapping statuses endpoint Test coverage for projects mapping endpoints Jul 9, 2024
Copy link
Member

@spwoodcock spwoodcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Great work on this πŸ’₯

@spwoodcock spwoodcock merged commit f4a8a14 into hotosm:development Jul 9, 2024
4 of 5 checks passed
@spwoodcock spwoodcock added the tests Related to automated code tests label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code tests Related to automated code tests
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants