diff --git a/scribemi/__init__.py b/scribemi/__init__.py new file mode 100644 index 0000000..2a8d7b4 --- /dev/null +++ b/scribemi/__init__.py @@ -0,0 +1 @@ +from .ScribeMi import MI diff --git a/tests/test_scribemi.py b/tests/test_scribemi.py index aa83b11..e3b8c7e 100644 --- a/tests/test_scribemi.py +++ b/tests/test_scribemi.py @@ -33,7 +33,15 @@ def test_fetch_credentials_with_username_and_password(self): def test_fetch_credentials_with_refresh_token(self): client = MI(env) client.authenticate(username_and_password) - client.authenticate({"refresh_token": client.tokens["refresh_token"]}) + tokens = client.tokens + if tokens != None: + refresh_token = tokens.get("refresh_token") + if refresh_token != None: + client.authenticate({"refresh_token": refresh_token}) + else: + assert False + else: + assert False def test_reauthenticate(self): client = MI(env) @@ -72,13 +80,14 @@ def test_endpoints(self): jobid = client.submit_task( "tests/companies_house_document.pdf", - { - "filetype": "pdf", - }, + {"filetype": "pdf"}, ) client.list_tasks() + if jobid == None: + assert False + task = client.get_task(jobid) try: