Commit 06460406 authored by Vladimir Repin's avatar Vladimir Repin
Browse files

Propagate test error and try it without localhost

parent 3ffc1c6c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -234,8 +234,8 @@ def prepare_enviroment():
        exit(0)

    if run_tests:
        tests(test_dir)
        exit(0)
        exitcode = tests(test_dir)
        exit(exitcode)


def tests(test_dir):
@@ -251,10 +251,11 @@ def tests(test_dir):
        proc = subprocess.Popen([sys.executable, *sys.argv], stdout=stdout, stderr=stderr)

    import test.server_poll
    test.server_poll.run_tests(proc, test_dir)
    exitcode = test.server_poll.run_tests(proc, test_dir)

    print(f"Stopping Web UI process with id {proc.pid}")
    proc.kill()
    return exitcode


def start():
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ import unittest

class TestExtrasWorking(unittest.TestCase):
    def setUp(self):
        self.url_img2img = "http://localhost:7860/sdapi/v1/extra-single-image"
        self.url_img2img = "http://127.0.0.1:7860/sdapi/v1/extra-single-image"
        self.simple_extras = {
            "resize_mode": 0,
            "show_extras_results": True,
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ import requests

class TestTxt2ImgWorking(unittest.TestCase):
    def setUp(self):
        self.url_txt2img = "http://localhost:7860/sdapi/v1/txt2img"
        self.url_txt2img = "http://127.0.0.1:7860/sdapi/v1/txt2img"
        self.simple_txt2img = {
            "enable_hr": False,
            "denoising_strength": 0,
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ from PIL import Image

class TestImg2ImgWorking(unittest.TestCase):
    def setUp(self):
        self.url_img2img = "http://localhost:7860/sdapi/v1/img2img"
        self.url_img2img = "http://127.0.0.1:7860/sdapi/v1/img2img"
        self.simple_img2img = {
            "init_images": [encode_pil_to_base64(Image.open(r"test/test_files/img2img_basic.png"))],
            "resize_mode": 0,
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ import requests

class TestTxt2ImgWorking(unittest.TestCase):
    def setUp(self):
        self.url_txt2img = "http://localhost:7860/sdapi/v1/txt2img"
        self.url_txt2img = "http://127.0.0.1:7860/sdapi/v1/txt2img"
        self.simple_txt2img = {
            "enable_hr": False,
            "denoising_strength": 0,
Loading