Bug
Client.rate_limit returns a plain dict but the README documents attribute access (.limit, .remaining, .reset).
The existing tests all pass green — but they test ApiClient directly, the internal layer:
from gocardless_pro import api_client
client = api_client.ApiClient('http://example.com', access_token)
Nobody tests Client (the public one users import). You can prove it breaks immediately:
❯ python -c "import gocardless_pro; c = gocardless_pro.Client(access_token='secret', base_url='http://example.com');
print(c.rate_limit.limit)"
AttributeError: 'dict' object has no attribute 'limit'
Fix
Added a test against the public Client — watched it fail:
FAILED tests/client_rate_limit_test.py::test_client_rate_limit_exposes_attributes
AttributeError: 'dict' object has no attribute 'limit'
Nothing in the codebase uses the dict keys ("ratelimit-limit", etc.) — every usage of client.rate_limit already expects
attribute access. The dict was dead code. One-line fix in client.py:
@property
def rate_limit(self):
return self._api_client.rate_limit
Tests green after:
PASSED tests/client_rate_limit_test.py::test_client_rate_limit_exposes_attributes
PR Ready
Branch with the fix and new test is at ausbernard/gocardless-pro-python → chore/recon-austin-bernard. Happy to open a PR but this repo requires collaborator access — let me know how you'd like contributions submitted.
Bug
Client.rate_limitreturns a plaindictbut the README documents attribute access (.limit,.remaining,.reset).The existing tests all pass green — but they test
ApiClientdirectly, the internal layer:Nobody tests
Client(the public one users import). You can prove it breaks immediately:Fix
Added a test against the public
Client— watched it fail:Nothing in the codebase uses the dict keys (
"ratelimit-limit", etc.) — every usage ofclient.rate_limitalready expectsattribute access. The dict was dead code. One-line fix in
client.py:Tests green after:
PR Ready
Branch with the fix and new test is at
ausbernard/gocardless-pro-python→chore/recon-austin-bernard. Happy to open a PR but this repo requires collaborator access — let me know how you'd like contributions submitted.