Skip to content

Fix issue #11: added test_delete_profile test and changed name to use…#69

Open
KarthiksSJEC wants to merge 3 commits intoanxkhn:mainfrom
KarthiksSJEC:main
Open

Fix issue #11: added test_delete_profile test and changed name to use…#69
KarthiksSJEC wants to merge 3 commits intoanxkhn:mainfrom
KarthiksSJEC:main

Conversation

@KarthiksSJEC
Copy link
Copy Markdown

Fix issue #11: added test_delete_profile test and changed name to username in create profile

@KarthiksSJEC KarthiksSJEC requested a review from anxkhn as a code owner February 14, 2026 09:56
Copilot AI review requested due to automatic review settings February 14, 2026 09:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issue #11 by adding test coverage for the DELETE /profile/{username} endpoint and fixing an incorrect assertion in the existing create profile test. The PR changes the assertion from checking "name" to "username" (matching the actual API response format) and adds a new test function that creates a profile, deletes it, verifies the deletion response, and confirms the profile no longer exists.

Changes:

  • Fixed incorrect field name in test_create_profile assertion (line 16): changed from "name" to "username"
  • Added test_delete_profile function to test the DELETE endpoint for existing profiles (lines 32-39)

Reviewed changes

Copilot reviewed 1 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_profile.py Fixed assertion field name and added DELETE endpoint test
tests/pycache/test_profile.cpython-312-pytest-9.0.1.pyc Python bytecode cache file (should not be tracked)
tests/pycache/conftest.cpython-312-pytest-9.0.1.pyc Python bytecode cache file (should not be tracked)
app/pycache/store.cpython-312.pyc Python bytecode cache file (should not be tracked)
app/pycache/models.cpython-312.pyc Python bytecode cache file (should not be tracked)
app/pycache/main.cpython-312.pyc Python bytecode cache file (should not be tracked)
app/pycache/init.cpython-312.pyc Python bytecode cache file (should not be tracked)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -29,3 +29,11 @@ def test_get_profile(clean_store):
def test_get_nonexistent_profile(clean_store):
response = client.get("/profile/nobody")
assert response.status_code == 404
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

Missing blank line before function definition. All other test functions in this file (lines 10, 19, 29) have a blank line before them for consistent spacing.

Suggested change
assert response.status_code == 404
assert response.status_code == 404

Copilot uses AI. Check for mistakes.
Comment on lines +32 to +39
def test_delete_profile(clean_store):
client.post("/profile", json={"username": "charlie", "bio": "tester"})
response = client.delete("/profile/charlie")
assert response.status_code == 200
assert response.json() == {"deleted": True}
# Verify it is actually gone
get_response = client.get("/profile/charlie")
assert get_response.status_code == 404 No newline at end of file
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

The test only covers deleting an existing profile. According to the acceptance criteria in issue #11, there should also be a test that attempts to delete a non-existent profile and verifies that it returns a 404 status code. Consider adding a separate test function like test_delete_nonexistent_profile to cover this case.

Copilot uses AI. Check for mistakes.
…onexistent_profile and changed name to userrname in create profile
…onexistent_profile and changed name to userrname in create profile
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