コード例 #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]