fix(gcp): Status extended ends with a dot (#2734)

This commit is contained in:
Pepe Fagoaga
2023-08-16 10:14:41 +02:00
committed by GitHub
parent 8cdc7b18c7
commit 8f091e7548
37 changed files with 87 additions and 91 deletions

View File

@@ -1,4 +1,3 @@
from re import search
from unittest import mock
GCP_PROJECT_ID = "123456789012"
@@ -50,9 +49,9 @@ class Test_bigquery_dataset_public_access:
assert len(result) == 1
assert result[0].status == "PASS"
assert search(
f"Dataset {dataset.name} is not publicly accessible",
result[0].status_extended,
assert (
result[0].status_extended
== f"Dataset {dataset.name} is not publicly accessible."
)
assert result[0].resource_id == dataset.id
assert result[0].resource_name == dataset.name
@@ -88,9 +87,9 @@ class Test_bigquery_dataset_public_access:
assert len(result) == 1
assert result[0].status == "FAIL"
assert search(
f"Dataset {dataset.name} is publicly accessible!",
result[0].status_extended,
assert (
result[0].status_extended
== f"Dataset {dataset.name} is publicly accessible."
)
assert result[0].resource_id == dataset.id
assert result[0].resource_name == dataset.name

View File

@@ -1,4 +1,3 @@
from re import search
from unittest import mock
GCP_PROJECT_ID = "123456789012"
@@ -62,9 +61,9 @@ class Test_compute_instance_default_service_account_in_use_with_full_api_access:
assert len(result) == 1
assert result[0].status == "PASS"
assert search(
f"The VM Instance {instance.name} is not configured to use the default service account with full access to all cloud APIs ",
result[0].status_extended,
assert (
result[0].status_extended
== f"The VM Instance {instance.name} is not configured to use the default service account with full access to all cloud APIs."
)
assert result[0].resource_id == instance.id
@@ -110,9 +109,9 @@ class Test_compute_instance_default_service_account_in_use_with_full_api_access:
assert len(result) == 1
assert result[0].status == "PASS"
assert search(
f"The VM Instance {instance.name} is not configured to use the default service account with full access to all cloud APIs ",
result[0].status_extended,
assert (
result[0].status_extended
== f"The VM Instance {instance.name} is not configured to use the default service account with full access to all cloud APIs."
)
assert result[0].resource_id == instance.id
@@ -158,8 +157,8 @@ class Test_compute_instance_default_service_account_in_use_with_full_api_access:
assert len(result) == 1
assert result[0].status == "FAIL"
assert search(
f"The VM Instance {instance.name} is configured to use the default service account with full access to all cloud APIs ",
result[0].status_extended,
assert (
result[0].status_extended
== f"The VM Instance {instance.name} is configured to use the default service account with full access to all cloud APIs."
)
assert result[0].resource_id == instance.id