Download test/server_poll.py from arbinger5217/arbinger: direct link, hf CLI and curl.
- Browser
- Download file 561 Bytes
-
https://huggingface.co/arbinger5217/arbinger/resolve/main/test/server_poll.py
- Command line
-
hf download hf://arbinger5217/arbinger/test/server_poll.py
-
curl -L -o server_poll.py https://huggingface.co/arbinger5217/arbinger/resolve/main/test/server_poll.py
561 Bytes
| import unittest | |
| import requests | |
| import time | |
| def run_tests(): | |
| 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") | |