Test params (#789)

This commit is contained in:
jbirddog 2023-12-07 08:09:44 -05:00 committed by GitHub
parent 6476799b11
commit d4e0fc69fd
1 changed files with 11 additions and 3 deletions

View File

@ -15,12 +15,20 @@ def no_feature_flags(app: Flask, with_db_and_bpmn_file_cleanup: None) -> Generat
class TestFeatureFlagService(BaseTest): class TestFeatureFlagService(BaseTest):
"""Tests the FeatureFlagService.""" """Tests the FeatureFlagService."""
def test_default_enabled_is_respected_when_no_feature_flag_exists( @pytest.mark.parametrize(
"default_enabled,expected",
[
pytest.param(True, True),
pytest.param(False, False),
],
)
def test_default_enabled_v0(
self, self,
no_feature_flags: None, no_feature_flags: None,
default_enabled: bool,
expected: bool,
) -> None: ) -> None:
assert FeatureFlagService.feature_enabled("some_feature", True) assert FeatureFlagService.feature_enabled("some_feature", default_enabled) == expected
assert not FeatureFlagService.feature_enabled("another_feature", False)
def test_default_feature_flag_value_overrides_passed_in_default_enabled( def test_default_feature_flag_value_overrides_passed_in_default_enabled(
self, self,