MLH-Fellowship / orientation-project-python-24.SPR.A

Orientation Project (Python for 24.SPR.A)
1 stars 3 forks source link

Implemented existing skills & created corresponding test case #43

Closed nfallah closed 9 months ago

nfallah commented 9 months ago

Summary

Added and updated the /resume/skill endpoint for PUT requests to accept a JSON and index to edit existing skills. On success, the new skill is returned in JSON format, and both data in memory and data.json on disk are updated.

Issue

This request closes issue #6.

Testing

An example PUT request for /resume/skill?index=value will succeed if a valid JSON is provided and value is numeric and within bounds. The provided test case test_skill_edit() in test_pytest.py calls this endpoint with index 0 and a new skill. It then validates its success by comparing it with a GET request at the same index.

Concerns

This implementation does not use the serialization class we discussed earlier as the issue has not yet been resolved. Similarly, index is obtained via query (not URL) parameters, which is another concern our team has discussed. Furthermore, a valid input JSON is one that simply includes all attributes found in the Skill class, so other dictionary entries are valid, but ignored.