mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
test(azure): subscription is None by default
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user