mirror of
https://github.com/akuker/RASCSI.git
synced 2025-02-21 07:29:28 +00:00
Updates to allow tests to run against a remote RaSCSI instance
This commit is contained in:
parent
1a15c4c648
commit
8062e5f5d7
@ -823,7 +823,7 @@ def test_show_logs(http_client):
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.text == "-- No entries --\n"
|
||||
assert response.headers["content-type"] == "text/plain"
|
||||
|
||||
|
||||
# route("/config/load", methods=["POST"])
|
||||
|
@ -4,15 +4,28 @@ import requests
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption("--base_url", action="store", default="http://localhost:8080")
|
||||
parser.addoption("--httpserver_host", action="store", default="host.docker.internal")
|
||||
parser.addoption("--httpserver_listen_address", action="store", default="127.0.0.1")
|
||||
parser.addoption("--rascsi_username", action="store", default="pi")
|
||||
parser.addoption("--rascsi_password", action="store", default="rascsi")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def httpserver_listen_address(pytestconfig):
|
||||
return (pytestconfig.getoption("httpserver_listen_address"), 0)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function", autouse=True)
|
||||
def set_httpserver_hostname(httpserver):
|
||||
def set_httpserver_hostname(pytestconfig, httpserver):
|
||||
# The HTTP requests are made by Python from within the container so we need
|
||||
# httpserver.url_for to generate URLs which point to the Docker host
|
||||
httpserver.host = "host.docker.internal"
|
||||
httpserver.host = pytestconfig.getoption("httpserver_host")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
def ensure_all_devices_detached(create_http_client):
|
||||
http_client = create_http_client()
|
||||
http_client.post("/scsi/detach_all")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
|
Loading…
x
Reference in New Issue
Block a user