-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
port_ocean/tests/clients/port/mixins/test_organization_mixin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import pytest | ||
from unittest.mock import MagicMock, AsyncMock | ||
|
||
from port_ocean.clients.port.mixins.organization import OrganizationClientMixin | ||
|
||
|
||
@pytest.fixture | ||
async def mocked_org_mixin() -> OrganizationClientMixin: | ||
auth = MagicMock() | ||
auth.headers = AsyncMock() | ||
auth.headers.return_value = {"auth": "enticated"} | ||
client = MagicMock() | ||
client.get = AsyncMock() | ||
client.get.return_value = MagicMock() | ||
client.get.return_value.json = MagicMock() | ||
client.get.return_value.json.return_value = { | ||
"organization": {"featureFlags": ["aa", "bb"]} | ||
} | ||
return OrganizationClientMixin(auth=auth, client=client) | ||
|
||
|
||
async def test_org_feature_flags_should_fetch_proper_json_path( | ||
mocked_org_mixin: OrganizationClientMixin, | ||
) -> None: | ||
result = await mocked_org_mixin.get_organization_feature_flags() | ||
|
||
assert result == ["aa", "bb"] |