Skip to content

Commit

Permalink
test login
Browse files Browse the repository at this point in the history
  • Loading branch information
matin committed Nov 17, 2019
1 parent 8caae07 commit 0271ff0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dhlmex/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Client:
...

def __init__(
self, username: Optional[str] = None, password: Optional[str] = None
self, username: Optional[str] = None, password: Optional[str] = None,
):
username = username or os.environ['DHLMEX_USERNAME']
password = password or os.environ['DHLMEX_PASSWORD']
Expand Down
14 changes: 14 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import pytest
from requests import Request


def remove_creds(request: Request) -> Request:
# remove username and password
return request


@pytest.fixture(scope='module')
def vcr_config() -> dict:
config = dict()
config['before_record_request'] = remove_creds
return config
14 changes: 14 additions & 0 deletions tests/test_client_login.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os

import pytest

from dhlmex import Client

DHLMEX_USERNAME = os.environ['DHLMEX_USERNAME']
DHLMEX_PASSWORD = os.environ['DHLMEX_PASSWORD']


@pytest.mark.vcr
def test_successful_login():
assert Client(DHLMEX_USERNAME, DHLMEX_PASSWORD)

0 comments on commit 0271ff0

Please sign in to comment.