1+ import os
2+
13import pytest
2- import vcr
34from scaleway .vpc .v2 import VpcV2API
45from scaleway_core .api import ScalewayException
56from scaleway_core .client import Client
@@ -20,7 +21,7 @@ def vpc_api():
2021
2122
2223@pytest .fixture (scope = "module" )
23- def create_delete_vpc_setup (vpc_api ):
24+ def vpc (vpc_api ):
2425 api , project_id , region = vpc_api
2526 with scw_vcr .use_cassette ("vpc_create_fixture_setup.yaml" ):
2627 vpc = api .create_vpc (
@@ -44,8 +45,8 @@ def private_networks_to_cleanup(vpc_api):
4445 api .delete_private_network (private_network_id = pn .id )
4546
4647
47- @scw_vcr .use_cassette ("test_delete_vpc .yaml" )
48- def test_delete_vpc (vpc_api ):
48+ @scw_vcr .use_cassette ("test_vpc_delete .yaml" )
49+ def test_vpc_delete (vpc_api ):
4950 api , project_id , region = vpc_api
5051 vpc = api .create_vpc (
5152 enable_routing = True ,
@@ -64,15 +65,15 @@ def test_delete_vpc(vpc_api):
6465
6566
6667@scw_vcr .use_cassette ("test_vpc_list.yaml" )
67- def test_list_vpcs (vpc_api ):
68+ def test_vpc_list (vpc_api ):
6869 api , _ , region = vpc_api
6970 vpcs = api .list_vp_cs (region = region )
7071 assert isinstance (vpcs .vpcs , list )
7172 assert vpcs .total_count >= created_vpc_count
7273
7374
7475@scw_vcr .use_cassette ("test_private_network_create.yaml" )
75- def test_create_private_network (vpc_api , vpc , private_networks_to_cleanup ):
76+ def test_private_network_create (vpc_api , vpc , private_networks_to_cleanup ):
7677 api , project_id , _ = vpc_api
7778 for i in range (created_pn_count ):
7879 pn = api .create_private_network (
@@ -86,31 +87,31 @@ def test_create_private_network(vpc_api, vpc, private_networks_to_cleanup):
8687
8788
8889@scw_vcr .use_cassette ("test_private_network_list.yaml" )
89- def test_list_private_network (vpc_api ):
90+ def test_private_network_list (vpc_api ):
9091 api , _ , region = vpc_api
9192 networks = api .list_private_networks (region = region )
9293 assert isinstance (networks .private_networks , list )
9394 assert networks .total_count >= created_pn_count
9495
9596
9697@scw_vcr .use_cassette ("test_vpc_get.yaml" )
97- def test_get_vpc (vpc_api , vpc ):
98+ def test_vpc_get (vpc_api , vpc ):
9899 api , _ , region = vpc_api
99100 fetched = api .get_vpc (vpc_id = vpc .id , region = region )
100101 assert fetched is not None
101102 assert fetched .id == vpc .id
102103
103104
104105@scw_vcr .use_cassette ("test_vpc_update.yaml" )
105- def test_update_vpc (vpc_api , vpc ):
106+ def test_vpc_update (vpc_api , vpc ):
106107 api , _ , _ = vpc_api
107108 updated = api .update_vpc (vpc_id = vpc .id , tags = tags )
108109 assert updated .tags == tags
109110 assert updated .id == vpc .id
110111
111112
112- @scw_vcr .use_cassette ("test_vpc_list _all .yaml" )
113- def test_list_vpc_all (vpc_api ):
113+ @scw_vcr .use_cassette ("test_vpc_list_all .yaml" )
114+ def test_vpc_list_all (vpc_api ):
114115 api , _ , _ = vpc_api
115116 vpcs = api .list_vp_cs_all ()
116117 assert isinstance (vpcs , list )
0 commit comments