@@ -26,13 +26,13 @@ def fxt_system_service() -> Mock:
2626
2727
2828class TestSystemEndpoints :
29- def test_get_devices_cpu_only (self , fxt_system_service : Mock , fxt_client : TestClient ):
30- """Test GET /api/system/devices with CPU only"""
31- fxt_system_service .get_devices .return_value = [
29+ def test_get_inference_devices_cpu_only (self , fxt_system_service : Mock , fxt_client : TestClient ):
30+ """Test GET /api/system/devices/inference with CPU only"""
31+ fxt_system_service .get_inference_devices .return_value = [
3232 DeviceInfo (type = DeviceType .CPU , name = "CPU" , memory = None , index = None ),
3333 ]
3434
35- response = fxt_client .get ("/api/system/devices" )
35+ response = fxt_client .get ("/api/system/devices/inference " )
3636
3737 assert response .status_code == status .HTTP_200_OK
3838 devices = response .json ()
@@ -42,14 +42,14 @@ def test_get_devices_cpu_only(self, fxt_system_service: Mock, fxt_client: TestCl
4242 assert devices [0 ]["memory" ] is None
4343 assert devices [0 ]["index" ] is None
4444
45- def test_get_devices_with_xpu (self , fxt_system_service : Mock , fxt_client : TestClient ):
46- """Test GET /api/system/devices with Intel XPU"""
47- fxt_system_service .get_devices .return_value = [
45+ def test_get_inference_devices_with_xpu (self , fxt_system_service : Mock , fxt_client : TestClient ):
46+ """Test GET /api/system/devices/inference with Intel XPU"""
47+ fxt_system_service .get_inference_devices .return_value = [
4848 DeviceInfo (type = DeviceType .CPU , name = "CPU" , memory = None , index = None ),
4949 DeviceInfo (type = DeviceType .XPU , name = "Intel(R) Graphics [0x7d41]" , memory = 36022263808 , index = 0 ),
5050 ]
5151
52- response = fxt_client .get ("/api/system/devices" )
52+ response = fxt_client .get ("/api/system/devices/inference " )
5353
5454 assert response .status_code == status .HTTP_200_OK
5555 devices = response .json ()
@@ -60,41 +60,6 @@ def test_get_devices_with_xpu(self, fxt_system_service: Mock, fxt_client: TestCl
6060 assert devices [1 ]["memory" ] == 36022263808
6161 assert devices [1 ]["index" ] == 0
6262
63- def test_get_devices_with_cuda (self , fxt_system_service : Mock , fxt_client : TestClient ):
64- """Test GET /api/system/devices with NVIDIA CUDA"""
65- fxt_system_service .get_devices .return_value = [
66- DeviceInfo (type = DeviceType .CPU , name = "CPU" , memory = None , index = None ),
67- DeviceInfo (type = DeviceType .CUDA , name = "NVIDIA GeForce RTX 4090" , memory = 25769803776 , index = 0 ),
68- ]
69-
70- response = fxt_client .get ("/api/system/devices" )
71-
72- assert response .status_code == status .HTTP_200_OK
73- devices = response .json ()
74- assert len (devices ) == 2
75- assert devices [0 ]["type" ] == "cpu"
76- assert devices [1 ]["type" ] == "cuda"
77- assert devices [1 ]["name" ] == "NVIDIA GeForce RTX 4090"
78- assert devices [1 ]["memory" ] == 25769803776
79- assert devices [1 ]["index" ] == 0
80-
81- def test_get_devices_with_all_devices (self , fxt_system_service : Mock , fxt_client : TestClient ):
82- """Test GET /api/system/devices with all device types"""
83- fxt_system_service .get_devices .return_value = [
84- DeviceInfo (type = DeviceType .CPU , name = "CPU" , memory = None , index = None ),
85- DeviceInfo (type = DeviceType .XPU , name = "Intel(R) Graphics [0x7d41]" , memory = 36022263808 , index = 0 ),
86- DeviceInfo (type = DeviceType .CUDA , name = "NVIDIA GeForce RTX 4090" , memory = 25769803776 , index = 0 ),
87- ]
88-
89- response = fxt_client .get ("/api/system/devices" )
90-
91- assert response .status_code == status .HTTP_200_OK
92- devices = response .json ()
93- assert len (devices ) == 3
94- assert devices [0 ]["type" ] == "cpu"
95- assert devices [1 ]["type" ] == "xpu"
96- assert devices [2 ]["type" ] == "cuda"
97-
9863 def test_get_memory (self , fxt_system_service : Mock , fxt_client : TestClient ):
9964 """Test GET /api/system/metrics/memory"""
10065 fxt_system_service .get_memory_usage .return_value = (1024.5 , 8192.0 )
0 commit comments