Skip to content

Commit

Permalink
added asserts for zAPI return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
mrzengel committed Aug 6, 2024
1 parent ab1acf7 commit 2b29b52
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions zenodo_jupyterlab/server/tests/test_testConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ async def test_zenodo_connection_success():
with patch.dict(os.environ, {'ZENODO_API_KEY': os.environ['CI_ZENODO_API_KEY']}):
with patch.dict(os.environ, {'ZENODO_SANDBOX': "true"}):
# Call the function to test
status_code = await checkZenodoConnection()
status_code, zAPI = await checkZenodoConnection()

print(f"Returned status code: {status_code}")

# Assert the expected status code
assert status_code == 200
assert type(zAPI) == ZenodoAPI

@pytest.mark.asyncio
async def test_zenodo_connection_failure():
Expand All @@ -33,7 +34,8 @@ async def test_zenodo_connection_failure():
with patch.dict(os.environ, {'ZENODO_API_KEY': 'fake_false_api_key'}):
with patch.dict(os.environ, {"ZENODO_SANDBOX": 'true'}):
# Call the function to test
status_code = await checkZenodoConnection()
status_code, zAPI = await checkZenodoConnection()

# Assert the expected status code
assert status_code == 0
assert status_code == 0
assert zAPI == None

0 comments on commit 2b29b52

Please sign in to comment.