|
1 | 1 | from unittest.mock import Mock, call |
2 | 2 |
|
3 | 3 | from openstack_mcp_server.tools.compute_tools import ComputeTools |
4 | | -from openstack_mcp_server.tools.response.compute import ( |
5 | | - Flavor, |
6 | | - Server, |
7 | | - ServerFlavor, |
8 | | - ServerImage, |
9 | | - ServerIp, |
10 | | - ServerSecurityGroup, |
11 | | -) |
| 4 | +from openstack_mcp_server.tools.response.compute import Flavor, Server |
12 | 5 |
|
13 | 6 |
|
14 | 7 | class TestComputeTools: |
@@ -80,31 +73,31 @@ def test_get_servers_success(self, mock_get_openstack_conn): |
80 | 73 | id="434eb822-3fbd-44a1-a000-3b511ac9b516", |
81 | 74 | name="web-server-01", |
82 | 75 | status="ACTIVE", |
83 | | - flavor=ServerFlavor(id=None, name="m1.tiny"), |
84 | | - image=ServerImage(id="de527f30-d078-41f4-8f18-a23bf2d39366"), |
| 76 | + flavor=Server.Flavor(id=None, name="m1.tiny"), |
| 77 | + image=Server.Image(id="de527f30-d078-41f4-8f18-a23bf2d39366"), |
85 | 78 | addresses={ |
86 | 79 | "private": [ |
87 | | - ServerIp(addr="192.168.1.10", version=4, type="fixed"), |
| 80 | + Server.IPAddress(addr="192.168.1.10", version=4, type="fixed"), |
88 | 81 | ], |
89 | 82 | }, |
90 | 83 | key_name="my-key", |
91 | | - security_groups=[ServerSecurityGroup(name="default")], |
| 84 | + security_groups=[Server.SecurityGroup(name="default")], |
92 | 85 | ), |
93 | 86 | Server( |
94 | 87 | id="ffd071fe-1334-45f6-8894-5b0bcac262a6", |
95 | 88 | name="db-server-01", |
96 | 89 | status="SHUTOFF", |
97 | | - flavor=ServerFlavor(id=None, name="m1.small"), |
98 | | - image=ServerImage(id="3d897e0e-4117-46bb-ae77-e734bb16a1ca"), |
| 90 | + flavor=Server.Flavor(id=None, name="m1.small"), |
| 91 | + image=Server.Image(id="3d897e0e-4117-46bb-ae77-e734bb16a1ca"), |
99 | 92 | addresses={ |
100 | 93 | "net1": [ |
101 | | - ServerIp(addr="192.168.1.11", version=4, type="fixed"), |
| 94 | + Server.IPAddress(addr="192.168.1.11", version=4, type="fixed"), |
102 | 95 | ], |
103 | 96 | }, |
104 | 97 | key_name=None, |
105 | 98 | security_groups=[ |
106 | | - ServerSecurityGroup(name="default"), |
107 | | - ServerSecurityGroup(name="group1"), |
| 99 | + Server.SecurityGroup(name="default"), |
| 100 | + Server.SecurityGroup(name="group1"), |
108 | 101 | ], |
109 | 102 | ), |
110 | 103 | ] |
|
0 commit comments