diff --git a/tests/test_simple.py b/tests/test_simple.py index d6b58d1e..1a9b67bf 100644 --- a/tests/test_simple.py +++ b/tests/test_simple.py @@ -9,7 +9,7 @@ def url_txt2img(base_url): @pytest.fixture() -def simple_txt2img_request(): +def error_txt2img_request(): return { "prompt": '1girl, yoimiya (genshin impact), origen, line, comet, wink, Masterpiece, BestQuality. UltraDetailed, , \n0: closed mouth\n8: open mouth,', "negative_prompt": "(sketch, duplicate, ugly, huge eyes, text, logo, monochrome, worst face, (bad and mutated hands:1.3), (worst quality:2.0), (low quality:2.0), (blurry:2.0), horror, geometry, bad_prompt_v2, (bad hands), (missing fingers), multiple limbs, bad anatomy, (interlocked fingers:1.2), Ugly Fingers, (extra digit and hands and fingers and legs and arms:1.4), crown braid, ((2girl)), (deformed fingers:1.2), (long fingers:1.2),succubus wings,horn,succubus horn,succubus hairstyle, (bad-artist-anime), bad-artist, bad hand, grayscale, skin spots, acnes, skin blemishes", @@ -28,14 +28,36 @@ def simple_txt2img_request(): } -def test_txt2img_simple_performed(url_txt2img, simple_txt2img_request): +@pytest.fixture() +def correct_txt2img_request(): + return { + "prompt": '1girl, yoimiya (genshin impact), origen, line, comet, wink, Masterpiece, BestQuality. UltraDetailed, , \n0: closed mouth\n2: open mouth,', + "negative_prompt": "(sketch, duplicate, ugly, huge eyes, text, logo, monochrome, worst face, (bad and mutated hands:1.3), (worst quality:2.0), (low quality:2.0), (blurry:2.0), horror, geometry, bad_prompt_v2, (bad hands), (missing fingers), multiple limbs, bad anatomy, (interlocked fingers:1.2), Ugly Fingers, (extra digit and hands and fingers and legs and arms:1.4), crown braid, ((2girl)), (deformed fingers:1.2), (long fingers:1.2),succubus wings,horn,succubus horn,succubus hairstyle, (bad-artist-anime), bad-artist, bad hand, grayscale, skin spots, acnes, skin blemishes", + "batch_size": 1, + "steps": 2, + "cfg_scale": 7, + "alwayson_scripts": { + 'AnimateDiff': { + 'args': [{ + 'enable': True, + 'batch_size': 2, + 'video_length': 4, + }] + } + } + } + + +def test_txt2img_simple_performed(url_txt2img, error_txt2img_request, correct_txt2img_request): ''' This test checks the following: - simple t2v generation - prompt travel - infinite context generator - motion lora + - error recovery ''' - response = requests.post(url_txt2img, json=simple_txt2img_request) + assert requests.post(url_txt2img, json=error_txt2img_request).status_code == 500 + response = requests.post(url_txt2img, json=correct_txt2img_request) assert response.status_code == 200 assert isinstance(response.json()['images'][0], str)