digitalocean / pydo

Official DigitalOcean Python Client based on the DO OpenAPIv3 specification
https://pypi.org/project/pydo/
Apache License 2.0
89 stars 20 forks source link

Add mocked tests: get_backup_policy #345

Closed loosla closed 1 month ago

loosla commented 1 month ago

Overview

Enhance test coverage by adding mocked test for the function that retrieves the backup policy for an existing droplet - get_backup_policy.

Mocked tests do not act against the real API so no real resources are created.

To run mocked tests, run: make test-mocked

Instructions

  1. Clone this repo.
  2. If you haven't already, install Python (version: >= 3.7.2) through their official installer.
  3. CD into the directory and run make install
  4. Open file: tests/mocked/test_droplets.py
  5. Add a mocked test with the name test_get_backup_policy for droplets.get_backup_policy.

Note: The function implementation can be found in src/pydo/operations/_operations.py.

gagan-bhullar-tech commented 1 month ago

@loosla get_backup_policy method is in DropletOperations. I think we need to add test case in test_droplets.py. Can you please confirm. Also, please assign it to me.

loosla commented 1 month ago

Thank you for catching that! I’ve updated the description.

gagan-bhullar-tech commented 1 month ago

@loosla thanks. Created PR. Please review.