Skip to content

Commit

Permalink
Add tests for comparison for equality.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 28, 2021
1 parent 486b9a8 commit c43d489
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion keyring/credentials.py
Expand Up @@ -31,8 +31,20 @@ def password(self):


class EnvironCredential(Credential):
"""Source credentials from environment variables.
"""
Source credentials from environment variables.
Actual sourcing is deferred until requested.
Supports comparison by equality.
>>> e1 = EnvironCredential('a', 'b')
>>> e2 = EnvironCredential('a', 'b')
>>> e3 = EnvironCredential('a', 'c')
>>> e1 == e2
True
>>> e2 == e3
False
"""

def __init__(self, user_env_var, pwd_env_var):
Expand Down

0 comments on commit c43d489

Please sign in to comment.