From d65ae7f5d982569d35c09e40252bbdcb1887ef64 Mon Sep 17 00:00:00 2001 From: Brett Powell Date: Wed, 31 Mar 2021 14:28:06 -0500 Subject: [PATCH] added tests for GcpMemorystoreMemcache resource --- 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 08df8b4..062e48e 100644 --- a/tests/test_resources.py +++ b/tests/test_resources.py @@ -41,6 +41,7 @@ from rpe.resources.gcp import GcpComputeSubnetwork from rpe.resources.gcp import GcpDataflowJob from rpe.resources.gcp import GcpMemorystoreRedis +from rpe.resources.gcp import GcpMemorystoreMemcache test_project = "my_project" test_resource_name = "my_resource" @@ -255,6 +256,16 @@ resource_type='redis.googleapis.com/Instance', name='//redis.googleapis.com/projects/my_project/locations/us-central1/instances/my_resource' ), + ResourceTestCase( + resource_data={ + 'name': test_resource_name, + 'location': 'us-central1', + 'project_id': test_project + }, + cls=GcpMemorystoreMemcache, + resource_type='memcache.googleapis.com/Instance', + name='//memcache.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 71a37c8..bab3bfe 100644 --- a/tests/test_resources_cai.py +++ b/tests/test_resources_cai.py @@ -44,6 +44,7 @@ from rpe.resources.gcp import GcpIamServiceAccountKey from rpe.resources.gcp import GcpDataflowJob from rpe.resources.gcp import GcpMemorystoreRedis +from rpe.resources.gcp import GcpMemorystoreMemcache client_kwargs = { 'credentials': Credentials(token='') @@ -220,6 +221,13 @@ }, resource_cls=GcpMemorystoreRedis ), + CaiTestCase( + data={ + "name": "//memcache.googleapis.com/projects/test-project/locations/us-central1/instances/test-resource", + "asset_type": "memcache.googleapis.com/Instance", + }, + resource_cls=GcpMemorystoreMemcache + ), ]