@@ -1244,7 +1244,7 @@ class EventFactoryIdNormalizationIntegrationTest(base.BaseTest):
12441244
12451245 These tests build real ``ImpressionEvent`` instances using crafted
12461246 Experiment/Variation objects, then call ``EventFactory.create_log_event``
1247- and inspect the dispatched payload. They exercise FR-001..FR-009.
1247+ and inspect the dispatched payload.
12481248 """
12491249
12501250 def setUp (self , * args , ** kwargs ):
@@ -1307,15 +1307,13 @@ def _dispatched_decision(self, impression_event):
13071307 snapshot = log_event .params ['visitors' ][0 ]['snapshots' ][0 ]
13081308 return snapshot ['decisions' ][0 ], snapshot ['events' ][0 ]
13091309
1310- # ------------------------------------------------------------------ FR-001
13111310 def test_valid_campaign_id_is_passed_through (self ):
13121311 impression = self ._build_impression ('111127' , '111182' , '111129' )
13131312 decision , event = self ._dispatched_decision (impression )
13141313 self .assertEqual ('111182' , decision ['campaign_id' ])
1315- # FR-009: entity_id mirrors campaign_id byte-for-byte.
1314+ # entity_id mirrors campaign_id byte-for-byte.
13161315 self .assertEqual (decision ['campaign_id' ], event ['entity_id' ])
13171316
1318- # ------------------------------------------------------------------ FR-002
13191317 def test_empty_campaign_id_falls_back_to_experiment_id (self ):
13201318 impression = self ._build_impression ('111127' , '' , '111129' )
13211319 decision , event = self ._dispatched_decision (impression )
@@ -1343,13 +1341,11 @@ def test_whitespace_campaign_id_passes_through(self):
13431341 self .assertEqual (' ' , decision ['campaign_id' ])
13441342 self .assertEqual (' ' , event ['entity_id' ])
13451343
1346- # ------------------------------------------------------------------ FR-003
13471344 def test_valid_variation_id_is_passed_through (self ):
13481345 impression = self ._build_impression ('111127' , '111182' , '111129' )
13491346 decision , _ = self ._dispatched_decision (impression )
13501347 self .assertEqual ('111129' , decision ['variation_id' ])
13511348
1352- # ------------------------------------------------------------------ FR-004
13531349 def test_empty_variation_id_becomes_none (self ):
13541350 impression = self ._build_impression ('111127' , '111182' , '' )
13551351 decision , _ = self ._dispatched_decision (impression )
@@ -1365,7 +1361,6 @@ def test_whitespace_variation_id_becomes_none(self):
13651361 decision , _ = self ._dispatched_decision (impression )
13661362 self .assertIsNone (decision ['variation_id' ])
13671363
1368- # ------------------------------------------------------------------ FR-005
13691364 def test_normalization_applies_to_rollout_decisions (self ):
13701365 impression = self ._build_impression (
13711366 '111127' , '' , 'bad_var' , rule_type = 'rollout'
@@ -1403,9 +1398,8 @@ def test_holdout_with_opaque_layer_id_passes_through(self):
14031398 self .assertEqual ('default-12345' , decision ['campaign_id' ])
14041399 self .assertEqual ('default-12345' , event ['entity_id' ])
14051400
1406- # ------------------------------------------------------------------ FR-006
14071401 def test_event_still_dispatches_when_all_ids_invalid (self ):
1408- """FR-006: never drop / fail dispatch ."""
1402+ """Event must still dispatch even when all IDs are invalid ."""
14091403 impression = self ._build_impression ('' , '' , '' )
14101404 log_event = EventFactory .create_log_event (impression , self .logger )
14111405 self .assertIsNotNone (log_event )
@@ -1416,9 +1410,8 @@ def test_event_still_dispatches_when_all_ids_invalid(self):
14161410 self .assertEqual ('' , event ['entity_id' ])
14171411 self .assertIsNone (decision ['variation_id' ])
14181412
1419- # ------------------------------------------------------------------ FR-009
14201413 def test_entity_id_equals_campaign_id_byte_for_byte (self ):
1421- """FR-009: ``events[].entity_id`` must equal ``decisions[].campaign_id``."""
1414+ """``events[].entity_id`` must equal ``decisions[].campaign_id``."""
14221415 for layer_id , exp_id , expected in [
14231416 ('111182' , '111127' , '111182' ), # numeric campaign_id wins
14241417 ('' , '111127' , '111127' ), # empty falls back to experiment_id
@@ -1433,11 +1426,8 @@ def test_entity_id_equals_campaign_id_byte_for_byte(self):
14331426 self .assertEqual (expected , decision ['campaign_id' ])
14341427 self .assertEqual (decision ['campaign_id' ], event ['entity_id' ])
14351428
1436- # ----------------------------------------------------------------- FR-010
14371429 def test_conversion_event_entity_id_unchanged (self ):
1438- """FR-010: conversion events derive entity_id from event.id, not the
1439- normalizer.
1440- """
1430+ """Conversion events derive entity_id from event.id, not the normalizer."""
14411431 from optimizely .event .user_event_factory import UserEventFactory
14421432
14431433 with mock .patch ('time.time' , return_value = 42.123 ), mock .patch (
0 commit comments