|
2 | 2 | import unittest |
3 | 3 | from datetime import datetime |
4 | 4 | from uuid import uuid4 |
5 | | -from posthog.contexts import get_context_session_id, set_context_session, new_context |
6 | 5 |
|
7 | 6 | import mock |
8 | 7 | import six |
9 | 8 | from parameterized import parameterized |
10 | 9 |
|
11 | 10 | from posthog.client import Client |
| 11 | +from posthog.contexts import get_context_session_id, new_context, set_context_session |
12 | 12 | from posthog.request import APIError |
13 | 13 | from posthog.test.test_utils import FAKE_TEST_API_KEY |
14 | 14 | from posthog.types import FeatureFlag, LegacyFlagMetadata |
@@ -2057,7 +2057,7 @@ def test_set_context_session_with_page_explicit_properties(self): |
2057 | 2057 |
|
2058 | 2058 | def test_set_context_session_override_in_capture(self): |
2059 | 2059 | """Test that explicit session ID overrides context session ID in capture""" |
2060 | | - from posthog.contexts import set_context_session, new_context |
| 2060 | + from posthog.contexts import new_context, set_context_session |
2061 | 2061 |
|
2062 | 2062 | with mock.patch("posthog.client.batch_post") as mock_post: |
2063 | 2063 | client = Client(FAKE_TEST_API_KEY, on_error=self.set_fail, sync_mode=True) |
@@ -2158,6 +2158,7 @@ def test_get_remote_config_payload_works_without_poller(self, patch_remote_confi |
2158 | 2158 | self.assertEqual(result, {"test": "payload"}) |
2159 | 2159 | patch_remote_config.assert_called_once_with( |
2160 | 2160 | "test-personal-key", |
| 2161 | + FAKE_TEST_API_KEY, |
2161 | 2162 | client.host, |
2162 | 2163 | "test-flag", |
2163 | 2164 | timeout=client.feature_flags_request_timeout_seconds, |
@@ -2282,9 +2283,7 @@ def test_get_feature_flag_result_with_empty_string_payload(self, patch_batch_pos |
2282 | 2283 | } |
2283 | 2284 | ] |
2284 | 2285 | }, |
2285 | | - "payloads": { |
2286 | | - "empty-variant": "" # Empty string payload |
2287 | | - }, |
| 2286 | + "payloads": {"empty-variant": ""}, # Empty string payload |
2288 | 2287 | }, |
2289 | 2288 | } |
2290 | 2289 | ] |
|
0 commit comments