Skip to content

Commit

Permalink
swap test
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-1991 committed Aug 28, 2024
1 parent 69c5611 commit ba994e7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,18 @@ def test_sword_api_requires_http_basic_auth(self):
def test_sword_api_can_authenticate(self):
BASE_URL = os.getenv("BASE_URL")
API_TOKEN = os.getenv("API_TOKEN")
api = SwordApi(BASE_URL, api_token=API_TOKEN)
response = api.get_service_document()
# api = SwordApi(BASE_URL, api_token=API_TOKEN)
# response = api.get_service_document()

assert API_TOKEN is not None, "API_TOKEN is not set"
assert len(API_TOKEN) > 0, "API_TOKEN is not set"

auth = httpx.BasicAuth(API_TOKEN, "")
response = httpx.get(
"http://localhost:8080/dvn/api/data-deposit/v1.1/swordv2/service-document",
auth=auth,
)

assert response.status_code == 200

def test_sword_api_cannot_authenticate_without_token(self):
Expand Down

0 comments on commit ba994e7

Please sign in to comment.