Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 67de5a3

Browse files
committed
feat: models alias
1 parent f5fbbb5 commit 67de5a3

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

engine/e2e-test/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
# from test_api_model_delete import TestApiModelDelete
1212
# from test_api_model_list import TestApiModelList
1313
# from test_api_model_get import TestApiModelGet
14-
from test_api_model_update import TestApiModelUpdate
14+
# from test_api_model_update import TestApiModelUpdate
15+
from test_api_model_alias import TestApiModelAlias
1516
###
1617
# from test_cli_engine_get import TestCliEngineGet
1718
# from test_cli_engine_install import TestCliEngineInstall
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import pytest
2+
import requests
3+
from test_runner import popen, run
4+
from test_runner import start_server, stop_server
5+
6+
7+
class TestApiModelAlias:
8+
9+
@pytest.fixture(autouse=True)
10+
def setup_and_teardown(self):
11+
# Setup
12+
success = start_server()
13+
if not success:
14+
raise Exception("Failed to start server")
15+
16+
# TODO: using pull with branch for easy testing tinyllama:gguf for example
17+
popen(["pull", "tinyllama"], "1\n")
18+
19+
yield
20+
21+
# Teardown
22+
# Clean up
23+
run("Delete model", ["models", "delete", "tinyllama:gguf"])
24+
stop_server()
25+
26+
def test_models_set_alias_should_be_successful(self):
27+
body_json = {'modelId': 'tinyllama:gguf',
28+
'modelAlias': 'tg'}
29+
response = requests.post("http://localhost:3928/models/alias", json = body_json)
30+
assert response.status_code == 200

0 commit comments

Comments
 (0)