@@ -277,15 +277,17 @@ def test_nodebalancer_types(test_linode_client):
277277
278278def test_nb_with_backend_only (test_linode_client , create_vpc_with_subnet ):
279279 client = test_linode_client
280- vpc = create_vpc_with_subnet [0 ].id
281- vpc_region = create_vpc_with_subnet [0 ].region
282- subnet = create_vpc_with_subnet [1 ].id
283280 label = get_test_label (8 )
284281
285282 nb = client .nodebalancer_create (
286- region = vpc_region ,
283+ region = create_vpc_with_subnet [ 0 ]. region ,
287284 label = label ,
288- vpcs = [{"vpc_id" : vpc , "subnet_id" : subnet }],
285+ vpcs = [
286+ {
287+ "vpc_id" : create_vpc_with_subnet [0 ].id ,
288+ "subnet_id" : create_vpc_with_subnet [1 ].id ,
289+ }
290+ ],
289291 )
290292
291293 assert isinstance (
@@ -320,13 +322,12 @@ def test_nb_with_frontend_ipv4_only_in_single_stack_vpc(
320322 test_linode_client , create_vpc_with_subnet_ipv4
321323):
322324 client = test_linode_client
323- vpc_region = create_vpc_with_subnet_ipv4 [0 ].region
324325 subnet = create_vpc_with_subnet_ipv4 [1 ].id
325326 label = get_test_label (8 )
326327 ipv4_address = "10.0.0.2" # first available address
327328
328329 nb = client .nodebalancer_create (
329- region = vpc_region ,
330+ region = create_vpc_with_subnet_ipv4 [ 0 ]. region ,
330331 label = label ,
331332 frontend_vpcs = [{"subnet_id" : subnet , "ipv4_range" : "10.0.0.0/24" }],
332333 type = "premium" ,
@@ -351,15 +352,18 @@ def test_nb_with_frontend_ipv6_only_in_single_stack_vpc(
351352 test_linode_client , create_vpc_with_subnet_ipv4
352353):
353354 client = test_linode_client
354- vpc_region = create_vpc_with_subnet_ipv4 [0 ].region
355- subnet = create_vpc_with_subnet_ipv4 [1 ].id
356355 label = get_test_label (8 )
357356
358357 with pytest .raises (ApiError ) as excinfo :
359358 client .nodebalancer_create (
360- region = vpc_region ,
359+ region = create_vpc_with_subnet_ipv4 [ 0 ]. region ,
361360 label = label ,
362- frontend_vpcs = [{"subnet_id" : subnet , "ipv6_range" : "/62" }],
361+ frontend_vpcs = [
362+ {
363+ "subnet_id" : create_vpc_with_subnet_ipv4 [1 ].id ,
364+ "ipv6_range" : "/62" ,
365+ }
366+ ],
363367 type = "premium" ,
364368 )
365369
@@ -372,15 +376,13 @@ def test_nb_with_frontend_and_default_type(
372376 test_linode_client , create_vpc_with_subnet
373377):
374378 client = test_linode_client
375- vpc_region = create_vpc_with_subnet [0 ].region
376- subnet = create_vpc_with_subnet [1 ].id
377379 label = get_test_label (8 )
378380
379381 with pytest .raises (ApiError ) as excinfo :
380382 client .nodebalancer_create (
381- region = vpc_region ,
383+ region = create_vpc_with_subnet [ 0 ]. region ,
382384 label = label ,
383- frontend_vpcs = [{"subnet_id" : subnet }],
385+ frontend_vpcs = [{"subnet_id" : create_vpc_with_subnet [ 1 ]. id }],
384386 )
385387
386388 error_msg = str (excinfo .value .json )
0 commit comments