mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 21:11:53 +00:00
feat(github): add new service Organization (#6300)
Co-authored-by: MrCloudSec <hello@mistercloudsec.com>
This commit is contained in:
committed by
GitHub
parent
9ecf570790
commit
484a773f5b
@@ -0,0 +1,35 @@
|
||||
from unittest.mock import patch
|
||||
|
||||
from prowler.providers.github.services.organization.organization_service import (
|
||||
Org,
|
||||
Organization,
|
||||
)
|
||||
from tests.providers.github.github_fixtures import set_mocked_github_provider
|
||||
|
||||
|
||||
def mock_list_organizations(_):
|
||||
return {
|
||||
1: Org(
|
||||
id=1,
|
||||
name="test-organization",
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@patch(
|
||||
"prowler.providers.github.services.organization.organization_service.Organization._list_organizations",
|
||||
new=mock_list_organizations,
|
||||
)
|
||||
class Test_Repository_Service:
|
||||
def test_get_client(self):
|
||||
repository_service = Organization(set_mocked_github_provider())
|
||||
assert repository_service.clients[0].__class__.__name__ == "Github"
|
||||
|
||||
def test_get_service(self):
|
||||
repository_service = Organization(set_mocked_github_provider())
|
||||
assert repository_service.__class__.__name__ == "Organization"
|
||||
|
||||
def test_list_organizations(self):
|
||||
repository_service = Organization(set_mocked_github_provider())
|
||||
assert len(repository_service.organizations) == 1
|
||||
assert repository_service.organizations[1].name == "test-organization"
|
||||
Reference in New Issue
Block a user