Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
Add tests for new resources
Browse files Browse the repository at this point in the history
  • Loading branch information
jceresini committed Dec 5, 2020
1 parent 35c196f commit bef3332
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from rpe.resources.gcp import GcpBigtableInstance
from rpe.resources.gcp import GcpCloudFunction
from rpe.resources.gcp import GcpComputeInstance
from rpe.resources.gcp import GcpComputeDisks
from rpe.resources.gcp import GcpComputeDisk
from rpe.resources.gcp import GcpDatafusionInstance
from rpe.resources.gcp import GcpDataprocCluster
from rpe.resources.gcp import GcpGkeCluster
Expand Down Expand Up @@ -95,7 +95,7 @@
'location': 'us-central1-a',
'project_id': test_project
},
cls=GcpComputeDisks,
cls=GcpComputeDisk,
resource_type='compute.googleapis.com/Disk',
name='//compute.googleapis.com/projects/my_project/zones/us-central1-a/disks/my_resource'
),
Expand Down
28 changes: 26 additions & 2 deletions tests/test_resources_cai.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
from rpe.resources.gcp import GcpBigtableInstance
from rpe.resources.gcp import GcpCloudFunction
from rpe.resources.gcp import GcpComputeInstance
from rpe.resources.gcp import GcpComputeDisks
from rpe.resources.gcp import GcpComputeDisk
from rpe.resources.gcp import GcpComputeRegionDisk
from rpe.resources.gcp import GcpDatafusionInstance
from rpe.resources.gcp import GcpDataprocCluster
from rpe.resources.gcp import GcpGkeCluster
Expand All @@ -39,6 +40,8 @@
from rpe.resources.gcp import GcpStorageBucket
from rpe.resources.gcp import GcpComputeFirewall
from rpe.resources.gcp import GcpComputeSubnetwork
from rpe.resources.gcp import GcpIamServiceAccount
from rpe.resources.gcp import GcpIamServiceAccountKey

client_kwargs = {
'credentials': Credentials(token='')
Expand Down Expand Up @@ -87,7 +90,14 @@
"name": "//compute.googleapis.com/projects/test-project/zones/us-central1-a/disks/test-resource",
"asset_type": "compute.googleapis.com/Disk",
},
resource_cls=GcpComputeDisks
resource_cls=GcpComputeDisk
),
CaiTestCase(
data={
"name": "//compute.googleapis.com/projects/test-project/regions/us-central1/disks/test-resource",
"asset_type": "compute.googleapis.com/RegionDisk",
},
resource_cls=GcpComputeRegionDisk
),
CaiTestCase(
data={
Expand Down Expand Up @@ -131,6 +141,20 @@
},
resource_cls=GcpGkeClusterNodepool
),
CaiTestCase(
data={
"name": "//iam.googleapis.com/projects/test-project/serviceAccounts/foo",
"asset_type": "iam.googleapis.com/ServiceAccount",
},
resource_cls=GcpIamServiceAccount
),
CaiTestCase(
data={
"name": "//iam.googleapis.com/projects/test-project/serviceAccounts/foo/keys/bar",
"asset_type": "iam.googleapis.com/ServiceAccountKey",
},
resource_cls=GcpIamServiceAccountKey
),
CaiTestCase(
data={
"name": "//pubsub.googleapis.com/projects/test-project/subscriptions/test-resource",
Expand Down

0 comments on commit bef3332

Please sign in to comment.