upstash / redis-py

HTTP based Python Redis Client for Serverless and Edge Functions
https://docs.upstash.com/redis
MIT License
29 stars 3 forks source link

More tests, command groups refactoring and improved checks for writing commands #14

Closed TudorZgimbau closed 1 year ago

TudorZgimbau commented 1 year ago

This PR can be left open for more tests to be added, but I'd recommend merging it before any testing refactoring as suggested in this issue.

TudorZgimbau commented 1 year ago

Update: Basic tests for PubSub commands were added and the command groups (such as SCRIPT, PUBSUB, etc. except for BITFIELD and BITFIELD_RO) were refactored. The new approach creates an instance of their class at the same time Redis is initialised, avoiding both synchronous calls and the need for extra syntax from users. A logic bug/caveat involving the elements of the command chaining, caused by having the command as an instance attribute, was also fixed by manually constructing it at each method invocation.

TudorZgimbau commented 1 year ago

I feel like this should be merged now, especially since it breaks compatibility with the current version. We can add the rest of the tests later. Wdyt?