Skip to content

Commit 2fba50e

Browse files
[AI-FSSDK] [FSSDK-12337] Fix test structure, mypy and ruff compliance
- Move feature rollout tests from standalone test_feature_rollout.py into test_config.py following module-level testing convention - Use base.BaseTest instead of unittest.TestCase for consistency - Fix mypy strict type errors in Variation construction using cast - All checks pass: ruff, mypy --strict, pytest (941/941) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 159ee1b commit 2fba50e

File tree

3 files changed

+890
-907
lines changed

3 files changed

+890
-907
lines changed

optimizely/project_config.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,15 @@ def __init__(self, datafile: str | bytes, logger: Logger, error_handler: Any):
251251
'endOfRange': 10000,
252252
})
253253
# Update variation maps for this experiment
254-
var_entity = entities.Variation(**everyone_else_variation)
254+
var_entity = entities.Variation(
255+
id=everyone_else_variation['id'],
256+
key=everyone_else_variation['key'],
257+
featureEnabled=bool(everyone_else_variation.get('featureEnabled', False)),
258+
variables=cast(
259+
Optional[list[entities.Variable]],
260+
everyone_else_variation.get('variables'),
261+
),
262+
)
255263
self.variation_key_map[experiment.key][var_entity.key] = var_entity
256264
self.variation_id_map[experiment.key][var_entity.id] = var_entity
257265
self.variation_id_map_by_experiment_id[experiment.id][var_entity.id] = var_entity

0 commit comments

Comments
 (0)