test(azure): subscription is None by default

This commit is contained in:
Pepe Fagoaga
2025-01-30 11:45:53 +01:00
parent de05d910e1
commit 4460bc2e82
2 changed files with 5 additions and 3 deletions
+1 -3
View File
@@ -475,7 +475,7 @@ class Check_Report_Azure(CheckReport):
resource_name: str
resource_id: str
subscription: str
subscription: str = None
location: str
def __init__(self, metadata: Dict, resource: Any) -> None:
@@ -496,8 +496,6 @@ class Check_Report_Azure(CheckReport):
except AttributeError:
self.resource_name = getattr(resource, "resource_name")
# TODO: review self.subscription
self.subscription = ""
self.location = getattr(resource, "location", "global")
+4
View File
@@ -424,6 +424,7 @@ class TestCheckReportAzure:
assert report.resource_id == "test_id"
assert report.resource_name == "test_name"
assert report.location == "test_location"
assert report.subscription is None
def test_check_report_azure_no_id(self):
resource = mock.Mock
@@ -442,6 +443,7 @@ class TestCheckReportAzure:
assert report.resource_id == "test_id"
assert report.resource_name == "test_name"
assert report.location == "global"
assert report.subscription is None
def test_check_report_azure_no_name(self):
resource = mock.Mock
@@ -460,6 +462,7 @@ class TestCheckReportAzure:
assert report.resource_id == "test_id"
assert report.resource_name == "test_name"
assert report.location == "global"
assert report.subscription is None
def test_check_report_azure_no_location(self):
resource = mock.Mock
@@ -469,3 +472,4 @@ class TestCheckReportAzure:
assert report.resource_id == "test_id"
assert report.resource_name == "test_name"
assert report.location == "global"
assert report.subscription is None