Skip to content

Commit 7416ac8

Browse files
committed
Use localhost with 80 port, count errors as well
1 parent 0646040 commit 7416ac8

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

test/advanced_features/extras_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class TestExtrasWorking(unittest.TestCase):
55
def setUp(self):
6-
self.url_img2img = "http://127.0.0.1:7860/sdapi/v1/extra-single-image"
6+
self.url_img2img = "http://localhost:80/sdapi/v1/extra-single-image"
77
self.simple_extras = {
88
"resize_mode": 0,
99
"show_extras_results": True,

test/advanced_features/txt2img_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class TestTxt2ImgWorking(unittest.TestCase):
66
def setUp(self):
7-
self.url_txt2img = "http://127.0.0.1:7860/sdapi/v1/txt2img"
7+
self.url_txt2img = "http://localhost:80/sdapi/v1/txt2img"
88
self.simple_txt2img = {
99
"enable_hr": False,
1010
"denoising_strength": 0,

test/basic_features/img2img_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class TestImg2ImgWorking(unittest.TestCase):
88
def setUp(self):
9-
self.url_img2img = "http://127.0.0.1:7860/sdapi/v1/img2img"
9+
self.url_img2img = "http://localhost:80/sdapi/v1/img2img"
1010
self.simple_img2img = {
1111
"init_images": [encode_pil_to_base64(Image.open(r"test/test_files/img2img_basic.png"))],
1212
"resize_mode": 0,

test/basic_features/txt2img_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class TestTxt2ImgWorking(unittest.TestCase):
66
def setUp(self):
7-
self.url_txt2img = "http://127.0.0.1:7860/sdapi/v1/txt2img"
7+
self.url_txt2img = "http://localhost:80/sdapi/v1/txt2img"
88
self.simple_txt2img = {
99
"enable_hr": False,
1010
"denoising_strength": 0,

test/basic_features/utils_test.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33

44
class UtilsTests(unittest.TestCase):
55
def setUp(self):
6-
self.url_options = "http://127.0.0.1:7860/sdapi/v1/options"
7-
self.url_cmd_flags = "http://127.0.0.1:7860/sdapi/v1/cmd-flags"
8-
self.url_samplers = "http://127.0.0.1:7860/sdapi/v1/samplers"
9-
self.url_upscalers = "http://127.0.0.1:7860/sdapi/v1/upscalers"
10-
self.url_sd_models = "http://127.0.0.1:7860/sdapi/v1/sd-models"
11-
self.url_hypernetworks = "http://127.0.0.1:7860/sdapi/v1/hypernetworks"
12-
self.url_face_restorers = "http://127.0.0.1:7860/sdapi/v1/face-restorers"
13-
self.url_realesrgan_models = "http://127.0.0.1:7860/sdapi/v1/realesrgan-models"
14-
self.url_prompt_styles = "http://127.0.0.1:7860/sdapi/v1/prompt-styles"
15-
self.url_artist_categories = "http://127.0.0.1:7860/sdapi/v1/artist-categories"
16-
self.url_artists = "http://127.0.0.1:7860/sdapi/v1/artists"
6+
self.url_options = "http://localhost:80/sdapi/v1/options"
7+
self.url_cmd_flags = "http://localhost:80/sdapi/v1/cmd-flags"
8+
self.url_samplers = "http://localhost:80/sdapi/v1/samplers"
9+
self.url_upscalers = "http://localhost:80/sdapi/v1/upscalers"
10+
self.url_sd_models = "http://localhost:80/sdapi/v1/sd-models"
11+
self.url_hypernetworks = "http://localhost:80/sdapi/v1/hypernetworks"
12+
self.url_face_restorers = "http://localhost:80/sdapi/v1/face-restorers"
13+
self.url_realesrgan_models = "http://localhost:80/sdapi/v1/realesrgan-models"
14+
self.url_prompt_styles = "http://localhost:80/sdapi/v1/prompt-styles"
15+
self.url_artist_categories = "http://localhost:80/sdapi/v1/artist-categories"
16+
self.url_artists = "http://localhost:80/sdapi/v1/artists"
1717

1818
def test_options_get(self):
1919
self.assertEqual(requests.get(self.url_options).status_code, 200)

test/server_poll.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def run_tests(proc, test_dir):
88
start_time = time.time()
99
while time.time()-start_time < timeout_threshold:
1010
try:
11-
requests.head("http://127.0.0.1:7860/")
11+
requests.head("http://localhost:80/")
1212
break
1313
except requests.exceptions.ConnectionError:
1414
if proc.poll() is not None:
@@ -18,7 +18,7 @@ def run_tests(proc, test_dir):
1818
test_dir = ""
1919
suite = unittest.TestLoader().discover(test_dir, pattern="*_test.py", top_level_dir="test")
2020
result = unittest.TextTestRunner(verbosity=2).run(suite)
21-
return len(result.failures)
21+
return len(result.failures) + len(result.errors)
2222
else:
2323
print("Launch unsuccessful")
2424
return 1

0 commit comments

Comments
 (0)