unitaryfund / metriq-client

Fork of papers-with-code client
https://metriq.info
Apache License 2.0
3 stars 9 forks source link

Testing: Convert examples to tests #80

Open vprusso opened 1 year ago

vprusso commented 1 year ago

The examples serve as a nice way to showcase how to make use of the capabilities of the client.

However, there is not presently a way in which to verify that these examples run successfully. Therefore, it may be preferable to convert the examples/ directory into a tests/ directory that has a file tree that looks like:

tests/
├─ test_methods/
│  ├─ test_method_get.py
│  ├─ test_method_get_names.py
│  ├─ test_method_get_submission_count.py
│  ├─ test_method_update.py
├─ test_platforms/
│  ├─ test_platform_add.py
│  ├─ test_platform_get.py
│  ├─ test_platform_update.py
├─ test_submissions/
│  ├─ test_submission_add.py
│  ├─ test_submission_add_method.py
│  ├─ test_submission_add_tag.py
│  ├─ test_submission_add_task.py
│  ├─ test_submission_delete.py
│  ├─ test_submission_get.py
│  ├─ test_submission_get_by_latest.py
│  ├─ test_submission_get_by_latest_tag.py
│  ├─ test_submission_get_by_popular.py
│  ├─ test_submission_get_by_popular_tag.py
│  ├─ test_submission_get_by_trending_tag.py
│  ├─ test_submission_update.py
│  ├─ test_submission_upvote.py
├─ test_results/
│  ├─ test_result_add.py
│  ├─ test_result_get.py
│  ├─ test_result_get.py
│  ├─ test_result_metric_names.py
├─ test_tags/
│  ├─ test_tag_get.py
│  ├─ test_tag_get_names.py
├─ test_tasks/
│  ├─ test_task_get.py
│  ├─ test_task_get_names.py
│  ├─ test_task_get_submission_count.py
│  ├─ test_task_update.py
├─ test_metriq_hello.py

Each of the test_*.py files would test the functionality of the examples, but would need to do so in a way that pytest can understand.