Skip to content

Commit

Permalink
Add tests for SchemeSelectable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 5, 2022
1 parent e55d996 commit ccd7d7d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions keyring/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,17 @@ class SchemeSelectable:
"""
Allow a backend to select different "schemes" for the
username and service.
>>> backend = SchemeSelectable()
>>> backend._query('contoso', 'alice')
{'username': 'alice', 'service': 'contoso'}
>>> backend._query('contoso')
{'service': 'contoso'}
>>> backend.scheme = 'KeypassXC'
>>> backend._query('contoso', 'alice')
{'UserName': 'alice', 'Title': 'contoso'}
>>> backend._query('contoso', 'alice', foo='bar')
{'UserName': 'alice', 'Title': 'contoso', 'foo': 'bar'}
"""

scheme = 'default'
Expand Down

0 comments on commit ccd7d7d

Please sign in to comment.