def test_hlookup_vlookup_error(): assert NA_ERROR == hlookup(1, 1, 1, 1) assert NA_ERROR == vlookup(1, 1, 1, 1) with pytest.raises(NotImplementedError, match='Array Formulas'): hlookup((1, 2), ((1, 2), (3, 4)), 1, 1) with pytest.raises(NotImplementedError, match='Array Formulas'): hlookup(1, ((1, 2), (3, 4)), (1, 2), 1) with pytest.raises(NotImplementedError, match='Array Formulas'): vlookup((1, 2), ((1, 2), (3, 4)), 1, 1) with pytest.raises(NotImplementedError, match='Array Formulas'): vlookup(1, ((1, 2), (3, 4)), (1, 2), 1)
def test_vlookup(lkup, col_idx, result, approx): table = ( ('A', 1, 'Z'), ('B', 2, 'Y'), ('C', 3, 'X'), ) assert result == vlookup(lkup, table, col_idx, approx)
def test_hlookup_vlookup_error(values, expected): assert hlookup(*values) == expected assert vlookup(*values) == expected