From d465edca2839728fca49e696fd0b7ae37f71c526 Mon Sep 17 00:00:00 2001 From: Brett Powell Date: Wed, 31 Mar 2021 11:51:01 -0500 Subject: [PATCH] added tests for Gcp Memorystore Redis --- tests/test_resources.py | 11 +++++++++++ tests/test_resources_cai.py | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/tests/test_resources.py b/tests/test_resources.py index 7b7392d..08df8b4 100644 --- a/tests/test_resources.py +++ b/tests/test_resources.py @@ -40,6 +40,7 @@ from rpe.resources.gcp import GcpComputeFirewall from rpe.resources.gcp import GcpComputeSubnetwork from rpe.resources.gcp import GcpDataflowJob +from rpe.resources.gcp import GcpMemorystoreRedis test_project = "my_project" test_resource_name = "my_resource" @@ -244,6 +245,16 @@ resource_type='dataflow.googleapis.com/Job', name='//dataflow.googleapis.com/projects/my_project/locations/us-central1/jobs/my_resource' ), + ResourceTestCase( + resource_data={ + 'name': test_resource_name, + 'location': 'us-central1', + 'project_id': test_project + }, + cls=GcpMemorystoreRedis, + resource_type='redis.googleapis.com/Instance', + name='//redis.googleapis.com/projects/my_project/locations/us-central1/instances/my_resource' + ), ] diff --git a/tests/test_resources_cai.py b/tests/test_resources_cai.py index 733baa6..71a37c8 100644 --- a/tests/test_resources_cai.py +++ b/tests/test_resources_cai.py @@ -43,6 +43,7 @@ from rpe.resources.gcp import GcpIamServiceAccount from rpe.resources.gcp import GcpIamServiceAccountKey from rpe.resources.gcp import GcpDataflowJob +from rpe.resources.gcp import GcpMemorystoreRedis client_kwargs = { 'credentials': Credentials(token='') @@ -212,6 +213,13 @@ }, resource_cls=GcpDataflowJob ), + CaiTestCase( + data={ + "name": "//redis.googleapis.com/projects/test-project/locations/us-central1/instances/test-resource", + "asset_type": "redis.googleapis.com/Instance", + }, + resource_cls=GcpMemorystoreRedis + ), ]