MIT-AI-Accelerator / MIT-AI-Accelerator/c3po-model-server
Adjust Mock Setup in weak learner upload
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1
- Forks
- 1
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 2
Description
While the current implementation works, it does risk erroring out if the underlying upload_file_to_minio implementation changes. Recommend adjusting to follow the mock pattern in the remainder of the same module. Specifically, adjust the following lines in test_upload_bertopic_embedding_pretrained_weak_learner_object_post_valid_request to directly patch the upload call:
# Dump the object to the file object
file_obj = io.BytesIO()
pickle.dump(weak_learner_model_obj, file_obj)
file_obj.seek(0)
# Upload the file to the BERTopic Embedding Pretrained Model object
response2 = client.post(
f"/aimodels/bertopic/bertopic-embedding-pretrained/{embedding_pretrained_id}/upload/", files={"new_file": file_obj})
os.remove(test_file)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the test containing test_upload_bertopic_embedding_pretrained_weak_learner_object_post_valid_request and compare its upload mocking with the other tests in the same module. Update the test to patch the upload call directly, then run the relevant test to confirm the request still succeeds and the temporary file cleanup remains covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100