Skip to content

Commit

Permalink
Mock OpenSearch in provider init test
Browse files Browse the repository at this point in the history
  • Loading branch information
ttuovinen committed Feb 7, 2024
1 parent c9b4ad5 commit 6ed2f05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/api/finland/test_opensearch_analytics_provider.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from unittest.mock import MagicMock, patch

from api.opensearch_analytics_provider import OpenSearchAnalyticsProvider
from core.analytics import Analytics
from core.local_analytics_provider import LocalAnalyticsProvider
Expand All @@ -8,7 +10,8 @@


class TestOpenSearchAnalytics:
def test_init_opensource_analytics(self):
@patch("api.opensearch_analytics_provider.OpenSearch")
def test_init_opensource_analytics(self, mock_opensearch=MagicMock()):
analytics = Analytics(
opensearch_analytics_enabled=True,
opensearch_analytics_index_prefix="circulation-events",
Expand Down

0 comments on commit 6ed2f05

Please sign in to comment.