-
Notifications
You must be signed in to change notification settings - Fork 166
Open
Description
Problem description
When I match the string value, the result is incorrect.
What actually happened
============================= test session starts =============================
collecting ... collected 3 items
test_lookup.py::test_match_for_string[1-lookup_array0-1-3]
test_lookup.py::test_match_for_string[B-lookup_array1-1-3] PASSED [ 33%]FAILED [ 66%]
tests\lib\test_lookup.py:403 (test_match_for_string[B-lookup_array1-1-3])
5 != 3
Expected :3
Actual :5
<Click to see difference>
lookup_value = 'B', lookup_array = ['A', None, 'B', None, 'C', None, ...]
match_type = 1, expected = 3
@pytest.mark.parametrize(
'lookup_value, lookup_array, match_type, expected', (
(1, [None, None, 1, 3.3, 5, None, None], 1, 3),
('B', ['A', None, 'B', None, 'C', None, 'D'], 1, 3),
(1, [2, None, 1, 3.3, 5, None, None], 1, 3),
))
def test_match_for_string(lookup_value, lookup_array, match_type, expected):
lookup_row = (tuple(lookup_array),)
lookup_col = tuple((i,) for i in lookup_array)
> assert match(lookup_value, lookup_row, match_type) == expected
E AssertionError: assert 5 == 3
E + where 5 = match('B', (('A', None, 'B', None, 'C', None, ...),), 1)
test_lookup.py:413: AssertionError
PASSED [100%]
test_lookup.py::test_match_for_string[1-lookup_array2-1-3]
=================== 1 failed, 2 passed, 1 warning in 0.29s ====================
Metadata
Metadata
Assignees
Labels
No labels