예제 #1
0
파일: test_utils.py 프로젝트: schipfer/pyam
def test_find_depth():
    obs = utils.find_depth(TEST_VARS)
    assert obs == [0, 1, 2]
예제 #2
0
파일: test_utils.py 프로젝트: schipfer/pyam
def test_find_depth_1_minus():
    obs = utils.find_depth(TEST_VARS, level='1-')
    assert obs == [True, True, False]
예제 #3
0
파일: test_utils.py 프로젝트: schipfer/pyam
def test_find_depth_1_plus():
    obs = utils.find_depth(TEST_VARS, level='1+')
    assert obs == [False, True, True]
예제 #4
0
파일: test_utils.py 프로젝트: schipfer/pyam
def test_find_depth_1():
    obs = utils.find_depth(TEST_VARS, level=1)
    assert obs == [False, True, False]
예제 #5
0
파일: test_utils.py 프로젝트: schipfer/pyam
def test_find_depth_0_plus():
    obs = utils.find_depth(TEST_VARS, level='0+')
    assert obs == [True, True, True]
예제 #6
0
파일: test_utils.py 프로젝트: schipfer/pyam
def test_find_depth_0():
    obs = utils.find_depth(TEST_VARS, level=0)
    assert obs == [True, False, False]
예제 #7
0
파일: test_utils.py 프로젝트: schipfer/pyam
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]
예제 #8
0
파일: test_utils.py 프로젝트: schipfer/pyam
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]