mollie / mollie-api-python

Mollie API client for Python
http://www.mollie.com
BSD 2-Clause "Simplified" License
113 stars 55 forks source link

Refactor resource classes #264

Closed whyscream closed 1 year ago

whyscream commented 1 year ago

We decided to overhaul the API interface of the client resources to make it more logical. No more methods on the client that don't work, f.i client.chargebacks.get(chargeback_id).

See the refactoring docs for details.

Related to #255

whyscream commented 1 year ago

Lines 7 to 9 of the class Capture (objects/capture.py) are not covered anymore by the unit tests. They were before, why is this changed?

The get_resource_class() method is only used in an ObjectList: https://github.com/mollie/mollie-api-python/blob/255-refactor-resources/mollie/api/objects/list.py#L87-L99. It seems that we don't have tests for get_next() and get_previous() for Captures. We have proper testing for list handling though. Maybe we can add a generic test later that tests listing behavior for all objects. Doesn't seem critital to me.

Also, there was a specific test for the get_resource_class method in https://github.com/mollie/mollie-api-python/pull/264/commits/1ecf00e9f420dc0ab4130367ad6b001af293187b#diff-c0ea9eb0c268270d1eef86969358c6c068cf56ed6e1040972ae5058a0bd11c3aL15-L18, but I removed that because it tests a virtually private method that is never used in the way it was tested.

whyscream commented 1 year ago

I've seen quite a few TODO comments in the PR. Is that something we wish to have on master or should that be adressed first?

Most TODOs are there to resolve in a later release. They're new features, missing functionality or nice-to-haves, but not part of this refactor or a blocker for a release. We can add github issues for all TODO items after the release?