File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 33
44from linode_api4 import (
55 LinodeInterface ,
6+ LinodeInterfacePublicIPv4AddressUpdateOptions ,
7+ LinodeInterfacePublicIPv6RangeUpdateOptions ,
68)
79
810
@@ -120,4 +122,54 @@ def test_get_vlan(self):
120122 iface .invalidate ()
121123 self .assert_linode_124_interface_789 (iface )
122124
125+ def test_update_public (self ):
126+ iface = LinodeInterface (self .client , 123 , 124 )
127+
128+ self .assert_linode_124_interface_123 (iface )
129+
130+ iface .default_route .ipv4 = False
131+ iface .default_route .ipv6 = False
132+
133+ iface .public .ipv4 .addresses = [
134+ LinodeInterfacePublicIPv4AddressUpdateOptions (
135+ address = "172.30.0.51" ,
136+ primary = False ,
137+ )
138+ ]
139+
140+ iface .public .ipv6 .ranges = [
141+ LinodeInterfacePublicIPv6RangeUpdateOptions (
142+ range = "2600:3cO9:e001:58::/64"
143+ )
144+ ]
145+
146+ with self .mock_put ("/linode/instances/124/interfaces/123" ) as m :
147+ iface .save ()
148+
149+ assert m .called
150+
151+ assert m .call_data == {
152+ "default_route" : {
153+ "ipv4" : False ,
154+ "ipv6" : False ,
155+ },
156+ "public" : {
157+ "ipv4" : {
158+ "addresses" : [
159+ {
160+ "address" : "172.30.0.51" ,
161+ "primary" : False ,
162+ },
163+ ]
164+ },
165+ "ipv6" : {
166+ "ranges" : [
167+ {
168+ "range" : "2600:3cO9:e001:58::/64" ,
169+ }
170+ ]
171+ },
172+ },
173+ }
174+
123175 # TODO (Enhanced Interfaces): iface update tests
You can’t perform that action at this time.
0 commit comments