aboutsummaryrefslogtreecommitdiff
path: root/test/server_poll.py
diff options
context:
space:
mode:
authorVladimir Repin <32306715+mezotaken@users.noreply.github.com>2022-10-29 18:26:28 +0300
committerVladimir Repin <32306715+mezotaken@users.noreply.github.com>2022-10-29 18:26:28 +0300
commitaf45b5a11a8a393ed404be3ce0ecac14338155c7 (patch)
tree4dea5d0d3955e3b97089bd5f313bc31fa337ea15 /test/server_poll.py
parent35c45df28b303a05d56a13cb56d4046f08cf8c25 (diff)
Testing with API added
Diffstat (limited to 'test/server_poll.py')
-rw-r--r--test/server_poll.py17
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")