Exemplo n.º 1
0
def test_find_depth():
    obs = utils.find_depth(TEST_VARS)
    assert obs == [0, 1, 2]
Exemplo n.º 2
0
def test_find_depth_1_minus():
    obs = utils.find_depth(TEST_VARS, level='1-')
    assert obs == [True, True, False]
Exemplo n.º 3
0
def test_find_depth_1_plus():
    obs = utils.find_depth(TEST_VARS, level='1+')
    assert obs == [False, True, True]
Exemplo n.º 4
0
def test_find_depth_1():
    obs = utils.find_depth(TEST_VARS, level=1)
    assert obs == [False, True, False]
Exemplo n.º 5
0
def test_find_depth_0_plus():
    obs = utils.find_depth(TEST_VARS, level='0+')
    assert obs == [True, True, True]
Exemplo n.º 6
0
def test_find_depth_0():
    obs = utils.find_depth(TEST_VARS, level=0)
    assert obs == [True, False, False]
Exemplo n.º 7
0
def test_find_depth_with_str_0():
    data = pd.Series(['foo', 'foo|bar|baz', 'bar|baz', 'bar|baz|foo'])
    obs = utils.find_depth(data, '*bar|', 0)
    assert obs == [False, True, True, False]
Exemplo n.º 8
0
def test_find_depth_with_str():
    data = pd.Series(['foo', 'foo|bar|baz', 'bar|baz', 'bar|baz|foo'])
    obs = utils.find_depth(data, 'bar')
    assert obs == [None, None, 1, 2]