Skip to content

Commit c3bbcff

Browse files
fix: address review comment
1 parent 99b35dc commit c3bbcff

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

api/conftest.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,6 @@ def api_client() -> APIClient:
555555
def feature(project: Project) -> Feature:
556556
return Feature.objects.create(name="Test Feature1", project=project) # type: ignore[no-any-return]
557557

558-
@pytest.fixture()
559-
def feauture_with_dots(project: Project) -> Feature:
560-
return Feature.objects.create(name="feature.name", project=project) # type: ignore[no-any-return]
561-
562558

563559
@pytest.fixture()
564560
def change_request(environment: Environment, admin_user: FFAdminUser) -> ChangeRequest:

api/tests/unit/app_analytics/test_unit_app_analytics_views.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@
1818
from app_analytics.models import FeatureEvaluationRaw
1919
from environments.identities.models import Identity
2020
from environments.models import Environment
21+
from api.integrations.launch_darkly.types import Project
2122
from features.models import Feature
2223
from organisations.models import (
2324
Organisation,
2425
OrganisationSubscriptionInformationCache,
2526
)
2627
from tests.types import EnableFeaturesFixture
2728

29+
@pytest.fixture()
30+
def feature_with_dots(project: Project) -> Feature:
31+
return Feature.objects.create(name="feature.with.dots", project=project) # type: ignore[no-any-return]
2832

2933
def test_sdk_analytics_ignores_bad_data(
3034
mocker: MockerFixture,
@@ -61,13 +65,13 @@ def test_sdk_analytics_ignores_bad_data(
6165
def test_sdk_analytics_ignores_feature_data_with_dots(
6266
mocker: MockerFixture,
6367
environment: Environment,
64-
feauture_with_dots: Feature,
68+
feature_with_dots: Feature,
6569
api_client: APIClient,
6670
) -> None:
6771
# Given
6872
api_client.credentials(HTTP_X_ENVIRONMENT_KEY=environment.api_key)
6973

70-
data = { feauture_with_dots.name: 20 }
74+
data = { feature_with_dots.name: 20 }
7175
mocked_feature_eval_cache = mocker.patch(
7276
"app_analytics.views.feature_evaluation_cache"
7377
)
@@ -85,8 +89,8 @@ def test_sdk_analytics_ignores_feature_data_with_dots(
8589

8690
mocked_feature_eval_cache.track_feature_evaluation.assert_called_once_with(
8791
environment_id=environment.id,
88-
feature_name=feauture_with_dots.name,
89-
evaluation_count=data[feauture_with_dots.name],
92+
feature_name=feature_with_dots.name,
93+
evaluation_count=data[feature_with_dots.name],
9094
labels={},
9195
)
9296

0 commit comments

Comments
 (0)