@@ -802,7 +802,8 @@ def test_get_configuration_with_envelope_and_raw(mocker, config):
802802
803803 assert "log_level" in config
804804 assert "log_level" not in features_config
805-
805+
806+
806807##
807808## Inequality test cases
808809##
@@ -828,9 +829,12 @@ def test_flags_not_equal_no_match(mocker, config):
828829 }
829830 }
830831 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
831- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" }, default = False )
832+ toggle = feature_flags .evaluate (
833+ name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" }, default = False
834+ )
832835 assert toggle == expected_value
833836
837+
834838def test_flags_not_equal_match (mocker , config ):
835839 expected_value = True
836840 mocked_app_config_schema = {
@@ -876,9 +880,14 @@ def test_flags_less_than_no_match_1(mocker, config):
876880 }
877881 }
878882 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
879- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.12.25" }, default = False )
883+ toggle = feature_flags .evaluate (
884+ name = "my_feature" ,
885+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.12.25" },
886+ default = False ,
887+ )
880888 assert toggle == expected_value
881889
890+
882891def test_flags_less_than_no_match_2 (mocker , config ):
883892 expected_value = False
884893 mocked_app_config_schema = {
@@ -899,9 +908,14 @@ def test_flags_less_than_no_match_2(mocker, config):
899908 }
900909 }
901910 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
902- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.10.31" }, default = False )
911+ toggle = feature_flags .evaluate (
912+ name = "my_feature" ,
913+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.10.31" },
914+ default = False ,
915+ )
903916 assert toggle == expected_value
904917
918+
905919def test_flags_less_than_match (mocker , config ):
906920 expected_value = True
907921 mocked_app_config_schema = {
@@ -922,10 +936,15 @@ def test_flags_less_than_match(mocker, config):
922936 }
923937 }
924938 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
925- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.04.01" }, default = False )
939+ toggle = feature_flags .evaluate (
940+ name = "my_feature" ,
941+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.04.01" },
942+ default = False ,
943+ )
926944 assert toggle == expected_value
927945
928- # Test less than or equal to
946+
947+ # Test less than or equal to
929948def test_flags_less_than_or_equal_no_match (mocker , config ):
930949 expected_value = False
931950 mocked_app_config_schema = {
@@ -946,9 +965,14 @@ def test_flags_less_than_or_equal_no_match(mocker, config):
946965 }
947966 }
948967 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
949- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.12.25" }, default = False )
968+ toggle = feature_flags .evaluate (
969+ name = "my_feature" ,
970+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.12.25" },
971+ default = False ,
972+ )
950973 assert toggle == expected_value
951974
975+
952976def test_flags_less_than_or_equal_match_1 (mocker , config ):
953977 expected_value = True
954978 mocked_app_config_schema = {
@@ -969,7 +993,11 @@ def test_flags_less_than_or_equal_match_1(mocker, config):
969993 }
970994 }
971995 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
972- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.04.01" }, default = False )
996+ toggle = feature_flags .evaluate (
997+ name = "my_feature" ,
998+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.04.01" },
999+ default = False ,
1000+ )
9731001 assert toggle == expected_value
9741002
9751003
@@ -993,9 +1021,14 @@ def test_flags_less_than_or_equal_match_2(mocker, config):
9931021 }
9941022 }
9951023 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
996- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.10.31" }, default = False )
1024+ toggle = feature_flags .evaluate (
1025+ name = "my_feature" ,
1026+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.10.31" },
1027+ default = False ,
1028+ )
9971029 assert toggle == expected_value
9981030
1031+
9991032# Test greater than
10001033def test_flags_greater_than_no_match_1 (mocker , config ):
10011034 expected_value = False
@@ -1017,9 +1050,14 @@ def test_flags_greater_than_no_match_1(mocker, config):
10171050 }
10181051 }
10191052 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
1020- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.04.01" }, default = False )
1053+ toggle = feature_flags .evaluate (
1054+ name = "my_feature" ,
1055+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.04.01" },
1056+ default = False ,
1057+ )
10211058 assert toggle == expected_value
10221059
1060+
10231061def test_flags_greater_than_no_match_2 (mocker , config ):
10241062 expected_value = False
10251063 mocked_app_config_schema = {
@@ -1040,9 +1078,14 @@ def test_flags_greater_than_no_match_2(mocker, config):
10401078 }
10411079 }
10421080 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
1043- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.10.31" }, default = False )
1081+ toggle = feature_flags .evaluate (
1082+ name = "my_feature" ,
1083+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.10.31" },
1084+ default = False ,
1085+ )
10441086 assert toggle == expected_value
10451087
1088+
10461089def test_flags_greater_than_match (mocker , config ):
10471090 expected_value = True
10481091 mocked_app_config_schema = {
@@ -1063,10 +1106,15 @@ def test_flags_greater_than_match(mocker, config):
10631106 }
10641107 }
10651108 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
1066- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.12.25" }, default = False )
1109+ toggle = feature_flags .evaluate (
1110+ name = "my_feature" ,
1111+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.12.25" },
1112+ default = False ,
1113+ )
10671114 assert toggle == expected_value
10681115
1069- # Test greater than or equal to
1116+
1117+ # Test greater than or equal to
10701118def test_flags_greater_than_or_equal_no_match (mocker , config ):
10711119 expected_value = False
10721120 mocked_app_config_schema = {
@@ -1087,9 +1135,14 @@ def test_flags_greater_than_or_equal_no_match(mocker, config):
10871135 }
10881136 }
10891137 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
1090- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.04.01" }, default = False )
1138+ toggle = feature_flags .evaluate (
1139+ name = "my_feature" ,
1140+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.04.01" },
1141+ default = False ,
1142+ )
10911143 assert toggle == expected_value
10921144
1145+
10931146def test_flags_greater_than_or_equal_match_1 (mocker , config ):
10941147 expected_value = True
10951148 mocked_app_config_schema = {
@@ -1110,7 +1163,11 @@ def test_flags_greater_than_or_equal_match_1(mocker, config):
11101163 }
11111164 }
11121165 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
1113- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.12.25" }, default = False )
1166+ toggle = feature_flags .evaluate (
1167+ name = "my_feature" ,
1168+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.12.25" },
1169+ default = False ,
1170+ )
11141171 assert toggle == expected_value
11151172
11161173
@@ -1134,6 +1191,9 @@ def test_flags_greater_than_or_equal_match_2(mocker, config):
11341191 }
11351192 }
11361193 feature_flags = init_feature_flags (mocker , mocked_app_config_schema , config )
1137- toggle = feature_flags .evaluate (name = "my_feature" , context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.10.31" }, default = False )
1194+ toggle = feature_flags .evaluate (
1195+ name = "my_feature" ,
1196+ context = {"tenant_id" : "345345435" , "username" : "a" , "current_date" : "2021.10.31" },
1197+ default = False ,
1198+ )
11381199 assert toggle == expected_value
1139-
0 commit comments