Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test /server-info endpoint in Dockerized environment #1020

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions dandi/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
from pathlib import Path
import time
from typing import Iterable, List
from urllib.parse import urlparse, urlunparse

import pytest
import requests
import responses
from semantic_version import Version

from .skip import mark
from .fixtures import DandiAPI
from .. import __version__
from ..consts import DandiInstance, known_instances
from ..exceptions import BadCliVersionError, CliVersionTooOldError
Expand Down Expand Up @@ -394,10 +395,10 @@ def test_get_instance_arbitrary_api_url() -> None:
)


@pytest.mark.xfail(reason="https://github.com/dandi/dandi-archive/issues/1045")
@mark.skipif_no_network
def test_server_info() -> None:
r = requests.get("https://dandiarchive.org/server-info")
def test_server_info(local_dandi_api: DandiAPI) -> None:
u = urlparse(local_dandi_api.api_url)
root_url = urlunparse(u[:2] + ("",) * 4)
r = requests.get(f"{root_url}/server-info")
r.raise_for_status()
data = r.json()
assert "version" in data
Expand Down