Skip to content

Commit

Permalink
Update test_condition.py
Browse files Browse the repository at this point in the history
  • Loading branch information
uzair-folio3 committed Sep 14, 2020
1 parent 7ed20f0 commit 4f2c05e
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions tests/helpers_tests/test_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,23 +361,23 @@ def test_exists__returns_true__when_user_provided_value_is_boolean(self):

self.assertStrictTrue(evaluator.evaluate(0))

def test_exact_string__returns_true__when_user_provided_value_is_equal_to_condition_value(self, ):
def test_exact_string__returns_true__when_user_provided_value_is_equal_to_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
exact_string_condition_list, {'favorite_constellation': 'Lacerta'}, self.mock_client_logger,
)

self.assertStrictTrue(evaluator.evaluate(0))

def test_exact_string__returns_false__when_user_provided_value_is_not_equal_to_condition_value(self, ):
def test_exact_string__returns_false__when_user_provided_value_is_not_equal_to_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
exact_string_condition_list, {'favorite_constellation': 'The Big Dipper'}, self.mock_client_logger,
)

self.assertStrictFalse(evaluator.evaluate(0))

def test_exact_string__returns_null__when_user_provided_value_is_different_type_from_condition_value(self, ):
def test_exact_string__returns_null__when_user_provided_value_is_different_type_from_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
exact_string_condition_list, {'favorite_constellation': False}, self.mock_client_logger,
Expand All @@ -393,7 +393,7 @@ def test_exact_string__returns_null__when_no_user_provided_value(self):

self.assertIsNone(evaluator.evaluate(0))

def test_exact_int__returns_true__when_user_provided_value_is_equal_to_condition_value(self, ):
def test_exact_int__returns_true__when_user_provided_value_is_equal_to_condition_value(self):

if PY2:
evaluator = condition_helper.CustomAttributeConditionEvaluator(
Expand All @@ -414,7 +414,7 @@ def test_exact_int__returns_true__when_user_provided_value_is_equal_to_condition

self.assertStrictTrue(evaluator.evaluate(0))

def test_exact_float__returns_true__when_user_provided_value_is_equal_to_condition_value(self, ):
def test_exact_float__returns_true__when_user_provided_value_is_equal_to_condition_value(self):

if PY2:
evaluator = condition_helper.CustomAttributeConditionEvaluator(
Expand All @@ -435,23 +435,23 @@ def test_exact_float__returns_true__when_user_provided_value_is_equal_to_conditi

self.assertStrictTrue(evaluator.evaluate(0))

def test_exact_int__returns_false__when_user_provided_value_is_not_equal_to_condition_value(self, ):
def test_exact_int__returns_false__when_user_provided_value_is_not_equal_to_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
exact_int_condition_list, {'lasers_count': 8000}, self.mock_client_logger
)

self.assertStrictFalse(evaluator.evaluate(0))

def test_exact_float__returns_false__when_user_provided_value_is_not_equal_to_condition_value(self, ):
def test_exact_float__returns_false__when_user_provided_value_is_not_equal_to_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
exact_float_condition_list, {'lasers_count': 8000.0}, self.mock_client_logger,
)

self.assertStrictFalse(evaluator.evaluate(0))

def test_exact_int__returns_null__when_user_provided_value_is_different_type_from_condition_value(self, ):
def test_exact_int__returns_null__when_user_provided_value_is_different_type_from_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
exact_int_condition_list, {'lasers_count': 'hi'}, self.mock_client_logger
Expand All @@ -465,7 +465,7 @@ def test_exact_int__returns_null__when_user_provided_value_is_different_type_fro

self.assertIsNone(evaluator.evaluate(0))

def test_exact_float__returns_null__when_user_provided_value_is_different_type_from_condition_value(self, ):
def test_exact_float__returns_null__when_user_provided_value_is_different_type_from_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
exact_float_condition_list, {'lasers_count': 'hi'}, self.mock_client_logger
Expand Down Expand Up @@ -522,23 +522,23 @@ def test_exact__given_number_values__calls_is_finite_number(self):

mock_is_finite.assert_has_calls([mock.call(9000), mock.call(9000)])

def test_exact_bool__returns_true__when_user_provided_value_is_equal_to_condition_value(self, ):
def test_exact_bool__returns_true__when_user_provided_value_is_equal_to_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
exact_bool_condition_list, {'did_register_user': False}, self.mock_client_logger,
)

self.assertStrictTrue(evaluator.evaluate(0))

def test_exact_bool__returns_false__when_user_provided_value_is_not_equal_to_condition_value(self, ):
def test_exact_bool__returns_false__when_user_provided_value_is_not_equal_to_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
exact_bool_condition_list, {'did_register_user': True}, self.mock_client_logger,
)

self.assertStrictFalse(evaluator.evaluate(0))

def test_exact_bool__returns_null__when_user_provided_value_is_different_type_from_condition_value(self, ):
def test_exact_bool__returns_null__when_user_provided_value_is_different_type_from_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
exact_bool_condition_list, {'did_register_user': 0}, self.mock_client_logger
Expand All @@ -554,15 +554,15 @@ def test_exact_bool__returns_null__when_no_user_provided_value(self):

self.assertIsNone(evaluator.evaluate(0))

def test_substring__returns_true__when_condition_value_is_substring_of_user_value(self, ):
def test_substring__returns_true__when_condition_value_is_substring_of_user_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
substring_condition_list, {'headline_text': 'Limited time, buy now!'}, self.mock_client_logger,
)

self.assertStrictTrue(evaluator.evaluate(0))

def test_substring__returns_false__when_condition_value_is_not_a_substring_of_user_value(self, ):
def test_substring__returns_false__when_condition_value_is_not_a_substring_of_user_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
substring_condition_list, {'headline_text': 'Breaking news!'}, self.mock_client_logger,
Expand All @@ -586,7 +586,7 @@ def test_substring__returns_null__when_no_user_provided_value(self):

self.assertIsNone(evaluator.evaluate(0))

def test_greater_than_int__returns_true__when_user_value_greater_than_condition_value(self, ):
def test_greater_than_int__returns_true__when_user_value_greater_than_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
gt_int_condition_list, {'meters_travelled': 48.1}, self.mock_client_logger
Expand All @@ -607,7 +607,7 @@ def test_greater_than_int__returns_true__when_user_value_greater_than_condition_

self.assertStrictTrue(evaluator.evaluate(0))

def test_greater_than_float__returns_true__when_user_value_greater_than_condition_value(self, ):
def test_greater_than_float__returns_true__when_user_value_greater_than_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
gt_float_condition_list, {'meters_travelled': 48.3}, self.mock_client_logger
Expand All @@ -628,7 +628,7 @@ def test_greater_than_float__returns_true__when_user_value_greater_than_conditio

self.assertStrictTrue(evaluator.evaluate(0))

def test_greater_than_int__returns_false__when_user_value_not_greater_than_condition_value(self, ):
def test_greater_than_int__returns_false__when_user_value_not_greater_than_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
gt_int_condition_list, {'meters_travelled': 47.9}, self.mock_client_logger
Expand All @@ -649,7 +649,7 @@ def test_greater_than_int__returns_false__when_user_value_not_greater_than_condi

self.assertStrictFalse(evaluator.evaluate(0))

def test_greater_than_float__returns_false__when_user_value_not_greater_than_condition_value(self, ):
def test_greater_than_float__returns_false__when_user_value_not_greater_than_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
gt_float_condition_list, {'meters_travelled': 48.2}, self.mock_client_logger
Expand Down Expand Up @@ -877,7 +877,7 @@ def test_less_than_int__returns_true__when_user_value_less_than_condition_value(

self.assertStrictTrue(evaluator.evaluate(0))

def test_less_than_float__returns_true__when_user_value_less_than_condition_value(self, ):
def test_less_than_float__returns_true__when_user_value_less_than_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
lt_float_condition_list, {'meters_travelled': 48.1}, self.mock_client_logger
Expand All @@ -898,7 +898,7 @@ def test_less_than_float__returns_true__when_user_value_less_than_condition_valu

self.assertStrictTrue(evaluator.evaluate(0))

def test_less_than_int__returns_false__when_user_value_not_less_than_condition_value(self, ):
def test_less_than_int__returns_false__when_user_value_not_less_than_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
lt_int_condition_list, {'meters_travelled': 48.1}, self.mock_client_logger
Expand All @@ -919,7 +919,7 @@ def test_less_than_int__returns_false__when_user_value_not_less_than_condition_v

self.assertStrictFalse(evaluator.evaluate(0))

def test_less_than_float__returns_false__when_user_value_not_less_than_condition_value(self, ):
def test_less_than_float__returns_false__when_user_value_not_less_than_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
lt_float_condition_list, {'meters_travelled': 48.2}, self.mock_client_logger
Expand Down Expand Up @@ -972,7 +972,7 @@ def test_less_than_float__returns_null__when_no_user_provided_value(self):

self.assertIsNone(evaluator.evaluate(0))

def test_less_than_or_equal_int__returns_true__when_user_value_less_than_or_equal_condition_value(self, ):
def test_less_than_or_equal_int__returns_true__when_user_value_less_than_or_equal_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
le_int_condition_list, {'meters_travelled': 47.9}, self.mock_client_logger
Expand Down Expand Up @@ -1005,7 +1005,7 @@ def test_less_than_or_equal_int__returns_true__when_user_value_less_than_or_equa

self.assertStrictTrue(evaluator.evaluate(0))

def test_less_than_or_equal_float__returns_true__when_user_value_less_than_or_equal_condition_value(self, ):
def test_less_than_or_equal_float__returns_true__when_user_value_less_than_or_equal_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
le_float_condition_list, {'meters_travelled': 48.1}, self.mock_client_logger
Expand All @@ -1032,7 +1032,7 @@ def test_less_than_or_equal_float__returns_true__when_user_value_less_than_or_eq

self.assertStrictTrue(evaluator.evaluate(0))

def test_less_than_or_equal_int__returns_false__when_user_value_not_less_than_or_equal_condition_value(self, ):
def test_less_than_or_equal_int__returns_false__when_user_value_not_less_than_or_equal_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
le_int_condition_list, {'meters_travelled': 48.1}, self.mock_client_logger
Expand All @@ -1053,7 +1053,7 @@ def test_less_than_or_equal_int__returns_false__when_user_value_not_less_than_or

self.assertStrictFalse(evaluator.evaluate(0))

def test_less_than_or_equal_float__returns_false__when_user_value_not_less_than_or_equal_condition_value(self, ):
def test_less_than_or_equal_float__returns_false__when_user_value_not_less_than_or_equal_condition_value(self):

evaluator = condition_helper.CustomAttributeConditionEvaluator(
le_float_condition_list, {'meters_travelled': 48.3}, self.mock_client_logger
Expand Down

0 comments on commit 4f2c05e

Please sign in to comment.