cloudant / python-cloudant

A Python library for Cloudant and CouchDB
Apache License 2.0
163 stars 55 forks source link

Support boolean type for `key`, `endkey`, and `startkey` in view requests #504

Closed mojito317 closed 3 years ago

mojito317 commented 3 years ago

Checklist

Description

Fixes #494

Approach

Allow bool type for endkey, key, and startkey.

Schema & API Changes

Security and Privacy

Testing

Edited the invalid tests to use {'foo': 'bar'} invalid values instead of booleans, and extended the existing tests to validate boolean types.

Monitoring and Logging

mojito317 commented 3 years ago

There's a couple of invalid tests that should be removed since boolean type is valid. For example: https://github.com/cloudant/python-cloudant/blob/master/tests/unit/param_translation_tests.py#L298 and https://github.com/cloudant/python-cloudant/blob/master/tests/unit/param_translation_tests.py#L243

We'll also want to modify existing tests to validate boolean types.

I fixed the tests in e876a39 then I realized there is a need for a modification in the code to pass the tests: d89eba6.

mojito317 commented 3 years ago

As @ricellis and I agreed offline I put back the invalid tests with {'foo': 'bar'} values that have to be invalid in e76f903.

mojito317 commented 3 years ago

Thank you for the review @emlaver and @ricellis! I'm merging this!