Skip to content

Commit 08b5d76

Browse files
author
tlfung0219
committed
add tests for the none type comparison
1 parent b4886d3 commit 08b5d76

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ def test_is_match_greater_than_value_check(self):
158158
result = utils.is_match(3, 5, constants.COMPARISON_GT)
159159
assert result is False
160160

161+
result = utils.is_match(None, 5, constants.COMPARISON_GT)
162+
assert result is False
163+
161164
def test_is_match_greater_than_equal_to_value_check(self):
162165
result = utils.is_match(5, 3, constants.COMPARISON_GTE)
163166
assert result is True
@@ -168,13 +171,19 @@ def test_is_match_greater_than_equal_to_value_check(self):
168171
result = utils.is_match(3, 5, constants.COMPARISON_GTE)
169172
assert result is False
170173

174+
result = utils.is_match(None, 5, constants.COMPARISON_GTE)
175+
assert result is False
176+
171177
def test_is_match_less_than_value_check(self):
172178
result = utils.is_match(1, 2, constants.COMPARISON_LT)
173179
assert result is True
174180

175181
result = utils.is_match(2, 2, constants.COMPARISON_LT)
176182
assert result is False
177183

184+
result = utils.is_match(None, 5, constants.COMPARISON_LT)
185+
assert result is False
186+
178187
def test_is_match_less_than_equal_to_value_check(self):
179188
result = utils.is_match(1, 2, constants.COMPARISON_LTE)
180189
assert result is True
@@ -185,6 +194,9 @@ def test_is_match_less_than_equal_to_value_check(self):
185194
result = utils.is_match(2, 1, constants.COMPARISON_LTE)
186195
assert result is False
187196

197+
result = utils.is_match(None, 5, constants.COMPARISON_LTE)
198+
assert result is False
199+
188200
def test_is_match_isnull_check(self):
189201
result = utils.is_match(1, True, constants.COMPARISON_ISNULL)
190202
assert result is False

0 commit comments

Comments
 (0)