stable-diffusion-webui/test/smoke/test_extras.py
m-cahill 975dda4b56
M03: Test architecture (#2)
* 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
2026-03-08 18:39:40 -07:00

35 lines
1.1 KiB
Python

import requests
def test_simple_upscaling_performed(base_url, img2img_basic_image_base64):
payload = {
"resize_mode": 0,
"show_extras_results": True,
"gfpgan_visibility": 0,
"codeformer_visibility": 0,
"codeformer_weight": 0,
"upscaling_resize": 2,
"upscaling_resize_w": 128,
"upscaling_resize_h": 128,
"upscaling_crop": True,
"upscaler_1": "Lanczos",
"upscaler_2": "None",
"extras_upscaler_2_visibility": 0,
"image": img2img_basic_image_base64,
}
assert requests.post(f"{base_url}/sdapi/v1/extra-single-image", json=payload).status_code == 200
def test_png_info_performed(base_url, img2img_basic_image_base64):
payload = {
"image": img2img_basic_image_base64,
}
assert requests.post(f"{base_url}/sdapi/v1/extra-single-image", json=payload).status_code == 200
def test_interrogate_performed(base_url, img2img_basic_image_base64):
payload = {
"image": img2img_basic_image_base64,
"model": "clip",
}
assert requests.post(f"{base_url}/sdapi/v1/extra-single-image", json=payload).status_code == 200