Skip to content

Commit

Permalink
[SQUASH] MOAR tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzaadi committed Jan 13, 2025
1 parent f057660 commit 72ce4f9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions port_ocean/tests/clients/port/mixins/test_organization_mixin.py
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"]

0 comments on commit 72ce4f9

Please sign in to comment.