diff --git a/tests/functional/feature_flags/test_feature_flags.py b/tests/functional/feature_flags/test_feature_flags.py index c421cc85423..8381dc6bf1d 100644 --- a/tests/functional/feature_flags/test_feature_flags.py +++ b/tests/functional/feature_flags/test_feature_flags.py @@ -802,7 +802,8 @@ def test_get_configuration_with_envelope_and_raw(mocker, config): assert "log_level" in config assert "log_level" not in features_config - + + ## ## Inequality test cases ## @@ -828,9 +829,12 @@ def test_flags_not_equal_no_match(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", context={"tenant_id": "345345435", "username": "a"}, default=False + ) assert toggle == expected_value + def test_flags_not_equal_match(mocker, config): expected_value = True mocked_app_config_schema = { @@ -876,9 +880,14 @@ def test_flags_less_than_no_match_1(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.12.25"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.12.25"}, + default=False, + ) assert toggle == expected_value + def test_flags_less_than_no_match_2(mocker, config): expected_value = False mocked_app_config_schema = { @@ -899,9 +908,14 @@ def test_flags_less_than_no_match_2(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.10.31"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.10.31"}, + default=False, + ) assert toggle == expected_value + def test_flags_less_than_match(mocker, config): expected_value = True mocked_app_config_schema = { @@ -922,10 +936,15 @@ def test_flags_less_than_match(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.04.01"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.04.01"}, + default=False, + ) assert toggle == expected_value -# Test less than or equal to + +# Test less than or equal to def test_flags_less_than_or_equal_no_match(mocker, config): expected_value = False mocked_app_config_schema = { @@ -946,9 +965,14 @@ def test_flags_less_than_or_equal_no_match(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.12.25"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.12.25"}, + default=False, + ) assert toggle == expected_value + def test_flags_less_than_or_equal_match_1(mocker, config): expected_value = True mocked_app_config_schema = { @@ -969,7 +993,11 @@ def test_flags_less_than_or_equal_match_1(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.04.01"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.04.01"}, + default=False, + ) assert toggle == expected_value @@ -993,9 +1021,14 @@ def test_flags_less_than_or_equal_match_2(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.10.31"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.10.31"}, + default=False, + ) assert toggle == expected_value + # Test greater than def test_flags_greater_than_no_match_1(mocker, config): expected_value = False @@ -1017,9 +1050,14 @@ def test_flags_greater_than_no_match_1(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.04.01"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.04.01"}, + default=False, + ) assert toggle == expected_value + def test_flags_greater_than_no_match_2(mocker, config): expected_value = False mocked_app_config_schema = { @@ -1040,9 +1078,14 @@ def test_flags_greater_than_no_match_2(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.10.31"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.10.31"}, + default=False, + ) assert toggle == expected_value + def test_flags_greater_than_match(mocker, config): expected_value = True mocked_app_config_schema = { @@ -1063,10 +1106,15 @@ def test_flags_greater_than_match(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.12.25"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.12.25"}, + default=False, + ) assert toggle == expected_value -# Test greater than or equal to + +# Test greater than or equal to def test_flags_greater_than_or_equal_no_match(mocker, config): expected_value = False mocked_app_config_schema = { @@ -1087,9 +1135,14 @@ def test_flags_greater_than_or_equal_no_match(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.04.01"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.04.01"}, + default=False, + ) assert toggle == expected_value + def test_flags_greater_than_or_equal_match_1(mocker, config): expected_value = True mocked_app_config_schema = { @@ -1110,7 +1163,11 @@ def test_flags_greater_than_or_equal_match_1(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.12.25"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.12.25"}, + default=False, + ) assert toggle == expected_value @@ -1134,6 +1191,9 @@ def test_flags_greater_than_or_equal_match_2(mocker, config): } } feature_flags = init_feature_flags(mocker, mocked_app_config_schema, config) - toggle = feature_flags.evaluate(name="my_feature", context={"tenant_id": "345345435", "username": "a", "current_date": "2021.10.31"}, default=False) + toggle = feature_flags.evaluate( + name="my_feature", + context={"tenant_id": "345345435", "username": "a", "current_date": "2021.10.31"}, + default=False, + ) assert toggle == expected_value -