mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-03-23 06:40:23 -07:00
* docs(M03): seed M03 plan and toolcalls Made-with: Cursor * ci: add repository guardrail, update CONTRIBUTING workflow Made-with: Cursor * M03: Test architecture (smoke/quality/nightly) - Move tests to test/smoke/, scaffold test/quality and test/nightly - Add pytest.ini with smoke/quality/nightly markers - Split CI: run_smoke_tests (PR), run_quality_tests (push main), run_nightly_tests (schedule) - Remove run_tests.yaml - Add prevent_upstream_push.sh pre-push hook template - Update CONTRIBUTING.md with hook install and test tier docs - Add repo and base-branch guardrails to workflows Made-with: Cursor * ci: remove obsolete warns_merge_master workflow (Serena uses main) Made-with: Cursor * fix: add base_url to pytest.ini for pytest-base-url plugin Made-with: Cursor * docs(M03): ledger, run1, audit, summary Made-with: Cursor * docs(M03): ledger commit 4ce5cde9 Made-with: Cursor
33 lines
934 B
Python
33 lines
934 B
Python
import pytest
|
|
import requests
|
|
|
|
|
|
def test_options_write(base_url):
|
|
url_options = f"{base_url}/sdapi/v1/options"
|
|
response = requests.get(url_options)
|
|
assert response.status_code == 200
|
|
|
|
pre_value = response.json()["send_seed"]
|
|
|
|
assert requests.post(url_options, json={'send_seed': (not pre_value)}).status_code == 200
|
|
|
|
response = requests.get(url_options)
|
|
assert response.status_code == 200
|
|
assert response.json()['send_seed'] == (not pre_value)
|
|
|
|
requests.post(url_options, json={"send_seed": pre_value})
|
|
|
|
|
|
@pytest.mark.parametrize("url", [
|
|
"sdapi/v1/cmd-flags",
|
|
"sdapi/v1/samplers",
|
|
"sdapi/v1/upscalers",
|
|
"sdapi/v1/sd-models",
|
|
"sdapi/v1/hypernetworks",
|
|
"sdapi/v1/face-restorers",
|
|
"sdapi/v1/realesrgan-models",
|
|
"sdapi/v1/prompt-styles",
|
|
"sdapi/v1/embeddings",
|
|
])
|
|
def test_get_api_url(base_url, url):
|
|
assert requests.get(f"{base_url}/{url}").status_code == 200
|