|
3 | 3 |
|
4 | 4 | from linode_api4 import ( |
5 | 5 | LinodeInterface, |
6 | | - LinodeInterfacePublicIPv4AddressUpdateOptions, |
7 | | - LinodeInterfacePublicIPv6RangeUpdateOptions, |
8 | | - LinodeInterfaceVPCIPv4AddressUpdateOptions, |
9 | | - LinodeInterfaceVPCIPv4RangeUpdateOptions, |
| 6 | + LinodeInterfaceDefaultRouteOptions, |
| 7 | + LinodeInterfaceOptions, |
| 8 | + LinodeInterfacePublicIPv4AddressOptions, |
| 9 | + LinodeInterfacePublicIPv4Options, |
| 10 | + LinodeInterfacePublicIPv6RangeOptions, |
| 11 | + LinodeInterfacePublicOptions, |
| 12 | + LinodeInterfaceVPCIPv4AddressOptions, |
| 13 | + LinodeInterfaceVPCIPv4RangeOptions, |
10 | 14 | ) |
11 | 15 |
|
12 | 16 |
|
| 17 | +def build_interface_options_public(): |
| 18 | + return LinodeInterfaceOptions( |
| 19 | + 123, |
| 20 | + default_route=LinodeInterfaceDefaultRouteOptions( |
| 21 | + ipv4=True, |
| 22 | + ipv6=True, |
| 23 | + ), |
| 24 | + public=LinodeInterfacePublicOptions( |
| 25 | + ipv4=LinodeInterfacePublicIPv4Options( |
| 26 | + addresses=[ |
| 27 | + LinodeInterfacePublicIPv4AddressOptions( |
| 28 | + address="172.30.0.50", primary=True |
| 29 | + ) |
| 30 | + ], |
| 31 | + ), |
| 32 | + ), |
| 33 | + ) |
| 34 | + |
| 35 | + |
13 | 36 | class LinodeInterfaceTest(ClientBaseCase): |
14 | 37 | """ |
15 | 38 | Tests methods of the LinodeInterface class |
@@ -133,14 +156,14 @@ def test_update_public(self): |
133 | 156 | iface.default_route.ipv6 = False |
134 | 157 |
|
135 | 158 | iface.public.ipv4.addresses = [ |
136 | | - LinodeInterfacePublicIPv4AddressUpdateOptions( |
| 159 | + LinodeInterfacePublicIPv4AddressOptions( |
137 | 160 | address="172.30.0.51", |
138 | 161 | primary=False, |
139 | 162 | ) |
140 | 163 | ] |
141 | 164 |
|
142 | 165 | iface.public.ipv6.ranges = [ |
143 | | - LinodeInterfacePublicIPv6RangeUpdateOptions( |
| 166 | + LinodeInterfacePublicIPv6RangeOptions( |
144 | 167 | range="2600:3cO9:e001:58::/64" |
145 | 168 | ) |
146 | 169 | ] |
@@ -184,13 +207,13 @@ def test_update_vpc(self): |
184 | 207 | iface.vpc.subnet_id = 456 |
185 | 208 |
|
186 | 209 | iface.vpc.ipv4.addresses = [ |
187 | | - LinodeInterfaceVPCIPv4AddressUpdateOptions( |
| 210 | + LinodeInterfaceVPCIPv4AddressOptions( |
188 | 211 | address="192.168.22.4", primary=False, nat_1_1_address="auto" |
189 | 212 | ) |
190 | 213 | ] |
191 | 214 |
|
192 | 215 | iface.vpc.ipv4.ranges = [ |
193 | | - LinodeInterfaceVPCIPv4RangeUpdateOptions( |
| 216 | + LinodeInterfaceVPCIPv4RangeOptions( |
194 | 217 | range="192.168.22.17/28", |
195 | 218 | ) |
196 | 219 | ] |
|
0 commit comments