13
13
14
14
import json
15
15
import mock
16
- from six import PY2
17
16
18
17
from optimizely .helpers import condition as condition_helper
19
18
@@ -394,13 +393,6 @@ def test_exact_string__returns_null__when_no_user_provided_value(self):
394
393
395
394
def test_exact_int__returns_true__when_user_provided_value_is_equal_to_condition_value (self , ):
396
395
397
- if PY2 :
398
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
399
- exact_int_condition_list , {'lasers_count' : long (9000 )}, self .mock_client_logger ,
400
- )
401
-
402
- self .assertStrictTrue (evaluator .evaluate (0 ))
403
-
404
396
evaluator = condition_helper .CustomAttributeConditionEvaluator (
405
397
exact_int_condition_list , {'lasers_count' : 9000 }, self .mock_client_logger
406
398
)
@@ -415,13 +407,6 @@ def test_exact_int__returns_true__when_user_provided_value_is_equal_to_condition
415
407
416
408
def test_exact_float__returns_true__when_user_provided_value_is_equal_to_condition_value (self , ):
417
409
418
- if PY2 :
419
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
420
- exact_float_condition_list , {'lasers_count' : long (9000 )}, self .mock_client_logger ,
421
- )
422
-
423
- self .assertStrictTrue (evaluator .evaluate (0 ))
424
-
425
410
evaluator = condition_helper .CustomAttributeConditionEvaluator (
426
411
exact_float_condition_list , {'lasers_count' : 9000 }, self .mock_client_logger
427
412
)
@@ -599,13 +584,6 @@ def test_greater_than_int__returns_true__when_user_value_greater_than_condition_
599
584
600
585
self .assertStrictTrue (evaluator .evaluate (0 ))
601
586
602
- if PY2 :
603
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
604
- gt_int_condition_list , {'meters_travelled' : long (49 )}, self .mock_client_logger ,
605
- )
606
-
607
- self .assertStrictTrue (evaluator .evaluate (0 ))
608
-
609
587
def test_greater_than_float__returns_true__when_user_value_greater_than_condition_value (self , ):
610
588
611
589
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -620,13 +598,6 @@ def test_greater_than_float__returns_true__when_user_value_greater_than_conditio
620
598
621
599
self .assertStrictTrue (evaluator .evaluate (0 ))
622
600
623
- if PY2 :
624
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
625
- gt_float_condition_list , {'meters_travelled' : long (49 )}, self .mock_client_logger ,
626
- )
627
-
628
- self .assertStrictTrue (evaluator .evaluate (0 ))
629
-
630
601
def test_greater_than_int__returns_false__when_user_value_not_greater_than_condition_value (self , ):
631
602
632
603
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -641,13 +612,6 @@ def test_greater_than_int__returns_false__when_user_value_not_greater_than_condi
641
612
642
613
self .assertStrictFalse (evaluator .evaluate (0 ))
643
614
644
- if PY2 :
645
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
646
- gt_int_condition_list , {'meters_travelled' : long (47 )}, self .mock_client_logger ,
647
- )
648
-
649
- self .assertStrictFalse (evaluator .evaluate (0 ))
650
-
651
615
def test_greater_than_float__returns_false__when_user_value_not_greater_than_condition_value (self , ):
652
616
653
617
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -662,13 +626,6 @@ def test_greater_than_float__returns_false__when_user_value_not_greater_than_con
662
626
663
627
self .assertStrictFalse (evaluator .evaluate (0 ))
664
628
665
- if PY2 :
666
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
667
- gt_float_condition_list , {'meters_travelled' : long (48 )}, self .mock_client_logger ,
668
- )
669
-
670
- self .assertStrictFalse (evaluator .evaluate (0 ))
671
-
672
629
def test_greater_than_int__returns_null__when_user_value_is_not_a_number (self ):
673
630
674
631
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -733,13 +690,6 @@ def test_greater_than_or_equal_int__returns_true__when_user_value_greater_than_o
733
690
734
691
self .assertStrictTrue (evaluator .evaluate (0 ))
735
692
736
- if PY2 :
737
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
738
- gt_int_condition_list , {'meters_travelled' : long (49 )}, self .mock_client_logger ,
739
- )
740
-
741
- self .assertStrictTrue (evaluator .evaluate (0 ))
742
-
743
693
def test_greater_than_or_equal_float__returns_true__when_user_value_greater_than_or_equal_condition_value (self ):
744
694
745
695
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -760,13 +710,6 @@ def test_greater_than_or_equal_float__returns_true__when_user_value_greater_than
760
710
761
711
self .assertStrictTrue (evaluator .evaluate (0 ))
762
712
763
- if PY2 :
764
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
765
- ge_float_condition_list , {'meters_travelled' : long (49 )}, self .mock_client_logger ,
766
- )
767
-
768
- self .assertStrictTrue (evaluator .evaluate (0 ))
769
-
770
713
def test_greater_than_or_equal_int__returns_false__when_user_value_not_greater_than_or_equal_condition_value (
771
714
self ):
772
715
@@ -782,13 +725,6 @@ def test_greater_than_or_equal_int__returns_false__when_user_value_not_greater_t
782
725
783
726
self .assertStrictFalse (evaluator .evaluate (0 ))
784
727
785
- if PY2 :
786
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
787
- ge_int_condition_list , {'meters_travelled' : long (47 )}, self .mock_client_logger ,
788
- )
789
-
790
- self .assertStrictFalse (evaluator .evaluate (0 ))
791
-
792
728
def test_greater_than_or_equal_float__returns_false__when_user_value_not_greater_than_or_equal_condition_value (
793
729
self ):
794
730
@@ -804,13 +740,6 @@ def test_greater_than_or_equal_float__returns_false__when_user_value_not_greater
804
740
805
741
self .assertStrictFalse (evaluator .evaluate (0 ))
806
742
807
- if PY2 :
808
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
809
- ge_float_condition_list , {'meters_travelled' : long (48 )}, self .mock_client_logger ,
810
- )
811
-
812
- self .assertStrictFalse (evaluator .evaluate (0 ))
813
-
814
743
def test_greater_than_or_equal_int__returns_null__when_user_value_is_not_a_number (self ):
815
744
816
745
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -869,13 +798,6 @@ def test_less_than_int__returns_true__when_user_value_less_than_condition_value(
869
798
870
799
self .assertStrictTrue (evaluator .evaluate (0 ))
871
800
872
- if PY2 :
873
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
874
- lt_int_condition_list , {'meters_travelled' : long (47 )}, self .mock_client_logger ,
875
- )
876
-
877
- self .assertStrictTrue (evaluator .evaluate (0 ))
878
-
879
801
def test_less_than_float__returns_true__when_user_value_less_than_condition_value (self , ):
880
802
881
803
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -890,13 +812,6 @@ def test_less_than_float__returns_true__when_user_value_less_than_condition_valu
890
812
891
813
self .assertStrictTrue (evaluator .evaluate (0 ))
892
814
893
- if PY2 :
894
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
895
- lt_float_condition_list , {'meters_travelled' : long (48 )}, self .mock_client_logger ,
896
- )
897
-
898
- self .assertStrictTrue (evaluator .evaluate (0 ))
899
-
900
815
def test_less_than_int__returns_false__when_user_value_not_less_than_condition_value (self , ):
901
816
902
817
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -911,13 +826,6 @@ def test_less_than_int__returns_false__when_user_value_not_less_than_condition_v
911
826
912
827
self .assertStrictFalse (evaluator .evaluate (0 ))
913
828
914
- if PY2 :
915
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
916
- lt_int_condition_list , {'meters_travelled' : long (49 )}, self .mock_client_logger ,
917
- )
918
-
919
- self .assertStrictFalse (evaluator .evaluate (0 ))
920
-
921
829
def test_less_than_float__returns_false__when_user_value_not_less_than_condition_value (self , ):
922
830
923
831
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -932,13 +840,6 @@ def test_less_than_float__returns_false__when_user_value_not_less_than_condition
932
840
933
841
self .assertStrictFalse (evaluator .evaluate (0 ))
934
842
935
- if PY2 :
936
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
937
- lt_float_condition_list , {'meters_travelled' : long (49 )}, self .mock_client_logger ,
938
- )
939
-
940
- self .assertStrictFalse (evaluator .evaluate (0 ))
941
-
942
843
def test_less_than_int__returns_null__when_user_value_is_not_a_number (self ):
943
844
944
845
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -991,19 +892,6 @@ def test_less_than_or_equal_int__returns_true__when_user_value_less_than_or_equa
991
892
992
893
self .assertStrictTrue (evaluator .evaluate (0 ))
993
894
994
- if PY2 :
995
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
996
- le_int_condition_list , {'meters_travelled' : long (47 )}, self .mock_client_logger ,
997
- )
998
-
999
- self .assertStrictTrue (evaluator .evaluate (0 ))
1000
-
1001
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
1002
- le_int_condition_list , {'meters_travelled' : long (48 )}, self .mock_client_logger ,
1003
- )
1004
-
1005
- self .assertStrictTrue (evaluator .evaluate (0 ))
1006
-
1007
895
def test_less_than_or_equal_float__returns_true__when_user_value_less_than_or_equal_condition_value (self ):
1008
896
1009
897
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -1024,13 +912,6 @@ def test_less_than_or_equal_float__returns_true__when_user_value_less_than_or_eq
1024
912
1025
913
self .assertStrictTrue (evaluator .evaluate (0 ))
1026
914
1027
- if PY2 :
1028
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
1029
- le_float_condition_list , {'meters_travelled' : long (48 )}, self .mock_client_logger ,
1030
- )
1031
-
1032
- self .assertStrictTrue (evaluator .evaluate (0 ))
1033
-
1034
915
def test_less_than_or_equal_int__returns_false__when_user_value_not_less_than_or_equal_condition_value (self ):
1035
916
1036
917
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -1045,13 +926,6 @@ def test_less_than_or_equal_int__returns_false__when_user_value_not_less_than_or
1045
926
1046
927
self .assertStrictFalse (evaluator .evaluate (0 ))
1047
928
1048
- if PY2 :
1049
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
1050
- le_int_condition_list , {'meters_travelled' : long (49 )}, self .mock_client_logger ,
1051
- )
1052
-
1053
- self .assertStrictFalse (evaluator .evaluate (0 ))
1054
-
1055
929
def test_less_than_or_equal_float__returns_false__when_user_value_not_less_than_or_equal_condition_value (self ):
1056
930
1057
931
evaluator = condition_helper .CustomAttributeConditionEvaluator (
@@ -1066,13 +940,6 @@ def test_less_than_or_equal_float__returns_false__when_user_value_not_less_than_
1066
940
1067
941
self .assertStrictFalse (evaluator .evaluate (0 ))
1068
942
1069
- if PY2 :
1070
- evaluator = condition_helper .CustomAttributeConditionEvaluator (
1071
- le_float_condition_list , {'meters_travelled' : long (49 )}, self .mock_client_logger ,
1072
- )
1073
-
1074
- self .assertStrictFalse (evaluator .evaluate (0 ))
1075
-
1076
943
def test_less_than_or_equal_int__returns_null__when_user_value_is_not_a_number (self ):
1077
944
1078
945
evaluator = condition_helper .CustomAttributeConditionEvaluator (
0 commit comments