diff options
author | Vladimir Repin <32306715+mezotaken@users.noreply.github.com> | 2022-10-29 15:26:28 +0000 |
---|---|---|
committer | Vladimir Repin <32306715+mezotaken@users.noreply.github.com> | 2022-10-29 15:26:28 +0000 |
commit | af45b5a11a8a393ed404be3ce0ecac14338155c7 (patch) | |
tree | 4dea5d0d3955e3b97089bd5f313bc31fa337ea15 /test/server_poll.py | |
parent | 35c45df28b303a05d56a13cb56d4046f08cf8c25 (diff) | |
download | stable-diffusion-webui-gfx803-af45b5a11a8a393ed404be3ce0ecac14338155c7.tar.gz stable-diffusion-webui-gfx803-af45b5a11a8a393ed404be3ce0ecac14338155c7.tar.bz2 stable-diffusion-webui-gfx803-af45b5a11a8a393ed404be3ce0ecac14338155c7.zip |
Testing with API added
Diffstat (limited to 'test/server_poll.py')
-rw-r--r-- | test/server_poll.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/server_poll.py b/test/server_poll.py new file mode 100644 index 00000000..8c0436f8 --- /dev/null +++ b/test/server_poll.py @@ -0,0 +1,17 @@ +import unittest +import requests +import time + +timeout_threshold = 240 +start_time = time.time() +while time.time()-start_time < timeout_threshold: + try: + requests.head("http://localhost:7860/") + break + except requests.exceptions.ConnectionError: + pass +if time.time()-start_time < timeout_threshold: + suite = unittest.TestLoader().discover('', pattern='*_test.py') + result = unittest.TextTestRunner(verbosity=2).run(suite) +else: + print("Launch unsuccessful") |