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

SFR-2311: API Edge Test Cases #480

Merged
merged 3 commits into from
Dec 19, 2024
Merged

SFR-2311: API Edge Test Cases #480

merged 3 commits into from
Dec 19, 2024

Conversation

ayan1229
Copy link
Contributor

This PR adds edge cases for following API end points

  • /edition/{id}
  • /link/{id}
  • /search
  • /work/{uuid}

Copy link
Contributor

@kylevillegas93 kylevillegas93 left a comment

Choose a reason for hiding this comment

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

These changes look good! I recommend using parametrize to reduce the number of tests, e.g.

import pytest

@pytest.mark.parametrize("test_id, expected_status", [
    ('00000000-0000-0000-0000-000000000000', 400), 
    ('invalid_id_format', 400),
    ('', 404),
    ('%$@!*', 400),
])
def test_get_edition_invalid_ids(test_id, expected_status):
    url = API_URL + f'/edition/{test_id}'
    
    response = requests.get(url)

    assert_response_status(url, response, expected_status)

Copy link
Contributor

@kylevillegas93 kylevillegas93 left a comment

Choose a reason for hiding this comment

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

Looks great - let's just rename one file!

@ayan1229 ayan1229 merged commit b0170b9 into main Dec 19, 2024
1 check passed
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