File tree Expand file tree Collapse file tree 2 files changed +32
-9
lines changed
Expand file tree Collapse file tree 2 files changed +32
-9
lines changed Original file line number Diff line number Diff line change @@ -121,16 +121,31 @@ def test_rdns_reset(self):
121121
122122 self .assertEqual (m .call_data_raw , '{"rdns": null}' )
123123
124- def test_vpc_nat_1_1 (self ):
124+ def test_get_ip (self ):
125125 """
126126 Tests that the vpc_nat_1_1 of an IP can be retrieved.
127127 """
128128
129129 ip = IPAddress (self .client , "127.0.0.1" )
130130
131- self .assertEqual (ip .vpc_nat_1_1 .vpc_id , 242 )
132- self .assertEqual (ip .vpc_nat_1_1 .subnet_id , 194 )
133- self .assertEqual (ip .vpc_nat_1_1 .address , "139.144.244.36" )
131+ def __validate_ip (_ip : IPAddress ):
132+ assert _ip .address == "127.0.0.1"
133+ assert _ip .gateway == "127.0.0.1"
134+ assert _ip .linode_id == 123
135+ assert _ip .interface_id == 123
136+ assert _ip .prefix == 24
137+ assert _ip .public
138+ assert _ip .rdns == "test.example.org"
139+ assert _ip .region == "us-east"
140+ assert _ip .subnet_mask == "255.255.255.0"
141+ assert _ip .type == "ipv4"
142+ assert _ip .vpc_nat_1_1 .vpc_id == 242
143+ assert _ip .vpc_nat_1_1 .subnet_id == 243
144+ assert _ip .vpc_nat_1_1 .address == "139.144.244.36"
145+
146+ __validate_ip (ip )
147+ ip .invalidate ()
148+ __validate_ip (ip )
134149
135150 def test_delete_ip (self ):
136151 """
Original file line number Diff line number Diff line change @@ -118,11 +118,19 @@ def validate_vpc_subnet_789(self, subnet: VPCSubnet):
118118 "2018-01-01T00:01:01" , DATE_FORMAT
119119 )
120120
121- self .assertEqual (subnet .label , "test-subnet" )
122- self .assertEqual (subnet .ipv4 , "10.0.0.0/24" )
123- self .assertEqual (subnet .linodes [0 ].id , 12345 )
124- self .assertEqual (subnet .created , expected_dt )
125- self .assertEqual (subnet .updated , expected_dt )
121+ assert subnet .label == "test-subnet"
122+ assert subnet .ipv4 == "10.0.0.0/24"
123+ assert subnet .linodes [0 ].id == 12345
124+ assert subnet .created == expected_dt
125+ assert subnet .updated == expected_dt
126+
127+ assert subnet .linodes [0 ].interfaces [0 ].id == 678
128+ assert subnet .linodes [0 ].interfaces [0 ].active
129+ assert subnet .linodes [0 ].interfaces [0 ].config_id is None
130+
131+ assert subnet .linodes [0 ].interfaces [1 ].id == 543
132+ assert not subnet .linodes [0 ].interfaces [1 ].active
133+ assert subnet .linodes [0 ].interfaces [1 ].config_id is None
126134
127135 def test_list_vpc_ips (self ):
128136 """
You can’t perform that action at this time.
0 commit comments