示例#1
0
def test_non_dict():
    assert try_get_value(1, '', 'n/a') == 'n/a'
示例#2
0
def test_middle_node(data):
    assert try_get_value(data, '1.B', 'n/a') == 'Bvalue'
示例#3
0
def test_empty(data):
    assert try_get_value(data, '', 'n/a') == 'n/a'
示例#4
0
def test_last_non_exists(data):
    assert try_get_value(data, '1.A.b', 'n/a') == 'n/a'
示例#5
0
def test_middle_non_exists(data):
    assert try_get_value(data, '1.c.a', 'n/a') == 'n/a'
示例#6
0
def test_non_dict():
    assert try_get_value(1, "", "n/a") == "n/a"
示例#7
0
def test_last_node(data):
    assert try_get_value(data, '1.A.a', None) == 'value'
示例#8
0
def test_empty(data):
    assert try_get_value(data, "", "n/a") == "n/a"
示例#9
0
def test_middle_node(data):
    assert try_get_value(data, "1.B", "n/a") == "Bvalue"
示例#10
0
def test_middle_non_exists(data):
    assert try_get_value(data, "1.c.a", "n/a") == "n/a"
示例#11
0
def test_last_non_exists(data):
    assert try_get_value(data, "1.A.b", "n/a") == "n/a"
示例#12
0
def test_last_node(data):
    assert try_get_value(data, "1.A.a", None) == "value"