Skip to content

Commit

Permalink
client: fix 403 test
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Oct 26, 2022
1 parent f033a2c commit 68ac5d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mpcontribs-client/mpcontribs/client/test_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
import os
import pytest

from unittest.mock import patch, MagicMock
Expand Down Expand Up @@ -61,12 +62,12 @@ def test_mock():


def test_live():
with Client(apikey="1234") as client:
with Client() as client:
assert client.url == f"https://{DEFAULT_HOST}"
spec = client.swagger_spec
headers = spec.http_client.session.headers
assert headers.get("Content-Type") == "application/json"
assert headers.get("x-api-key") == "1234"
assert headers.get("x-api-key") == os.environ.get("MPCONTRIBS_API_KEY")
assert spec.origin_url == f"https://{DEFAULT_HOST}/apispec.json"
assert spec.spec_dict["host"] == DEFAULT_HOST
assert spec.spec_dict["schemes"] == ["https"]
Expand Down

0 comments on commit 68ac5d0

Please sign in to comment.