Closed volodymyrZotov closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 76.96%. Comparing base (
627f59d
) to head (4bcf4d7
).
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks for fixing this @volodymyrZotov, I've created a PR as well fixing this but you was faster than me. Sorry for the bug I've introduced :(
Fell free to close my PR in favor of yours.
@raphapassini No worries! I also missed that when tested it. Thanks for the attempt to fix it! That looks like the right approach. But I lean toward merging this one as it also covers edge cases like setting None
and non-numeric values.
This PR fixes the issue when Client throws an error if
OP_CONNECT_CLIENT_REQ_TIMEOUT
env var is not set.In addition
get_timeout
function is improved to cover the following cases:export OP_CONNECT_CLIENT_REQ_TIMEOUT=None
- it disables all the timeouts (behaves the same as described in to documentation)export OP_CONNECT_CLIENT_REQ_TIMEOUT=''
- it sets default timeout 5s.export OP_CONNECT_CLIENT_REQ_TIMEOUT=0
-it sets default timeout 5s.Testing steps
The env var is set
main.py
fileclient: Client = new_client(host, token) #put your token an host vaults = client.get_vaults() print(vaults)
from onepasswordconnectsdk.client import AsyncClient, Client from onepasswordconnectsdk import new_client
client: Client = new_client(host, token) #put your token an host vaults = client.get_vaults() print(vaults)