diff --git a/tests/test_http.py b/tests/test_http.py deleted file mode 100644 index fb67fe3..0000000 --- a/tests/test_http.py +++ /dev/null @@ -1,28 +0,0 @@ -import subprocess -import time - -import httpx -from sparrow.multiprocess import kill -from utils import rm - - -class TestRun: - @classmethod - def setup_class(cls): - kill(8000) - base_url = "https://api.openai.com" - subprocess.Popen(["nohup", "openai-forward", "run", "--base_url", base_url]) - time.sleep(3) - - @classmethod - def teardown_class(cls): - kill(8000) - rm("nohup.out") - - def test_get_doc(self): - resp = httpx.get("http://localhost:8000/healthz") - assert resp.is_success - - def test_get_chat_completions(self): - resp = httpx.get("http://localhost:8000/v1/chat/completions") - assert resp.status_code == 401 diff --git a/tests/utils.py b/tests/utils.py deleted file mode 100644 index 8e2c449..0000000 --- a/tests/utils.py +++ /dev/null @@ -1,22 +0,0 @@ -import os -import shutil - -from sparrow import ls - - -def rm(*file_pattern: str, rel=False): - """Remove files or directories. - Example: - -------- - >>> rm("*.jpg", "*.png") - >>> rm("*.jpg", "*.png", rel=True) - """ - path_list = ls(".", *file_pattern, relp=rel, concat="extend") - for file in path_list: - if os.path.isfile(file): - print("remove ", file) - os.remove(file) - # os.system("rm -f " + file) - elif os.path.isdir(file): - shutil.rmtree(file, ignore_errors=True) - print("rm tree ", file)