Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add session passing to functions #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

samdixon
Copy link

  • Adds ability to pass session variable to get_password, set_password, and delete_password functions. Default = None.
  • Adds tests for new functionality with 100% coverage.
    • Double check these tests for validity. I don't have much exp writing tests.
  • Minor version bump from 0.2.1 to 0.2.2

@codecov
Copy link

codecov bot commented Oct 17, 2019

Codecov Report

Merging #4 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #4   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines         155    158    +3     
  Branches       18     21    +3     
=====================================
+ Hits          155    158    +3
Impacted Files Coverage Δ
bitwarden_keyring/__init__.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12531ba...790600e. Read the comment docs.

def get_password(service, username):
session = get_session(os.environ)
def get_password(service, username, session=None):
if session == None:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if session == None:
if session is None:

Copy link
Owner

@ewjoachim ewjoachim Sep 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about passing session to get_session() and doing the check over there ? This way, we won't have the check in multiple places in the code ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants