Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
def test_hlookup(lkup, col_idx, result, approx):
    table = (
        ('A', 'B', 'C'),
        (1, 2, 3),
        ('Z', 'Y', 'X'),
    )
    assert result == hlookup(lkup, table, col_idx, approx)
Ejemplo n.º 3
0
def test_hlookup(lkup, col_idx, result, approx):
    table = (
        ('A', 'B', 'C'),
        (1, 2, 3),
        ('Z', 'Y', 'X'),
    )
    assert result == hlookup(lkup, table, col_idx, approx)
Ejemplo n.º 4
0
def test_hlookup_vlookup_error(values, expected):
    assert hlookup(*values) == expected
    assert vlookup(*values) == expected
Ejemplo n.º 5
0
def test_hlookup_vlookup_error(values, expected):
    assert hlookup(*values) == expected
    assert vlookup(*values) == expected