コード例 #1
0
ファイル: test_as.py プロジェクト: dbew/treebeard
def test_as_list_converts_to_list_of_values(example_path, empty_context):
    a = as_list(example_path['%i'].bar['%j'])
    result = a._convert(empty_context)
    assert isinstance(result, list)
    assert sorted(result) == sorted([sentinel.foobarbaz,
                                     sentinel.moobarbaz,
                                     sentinel.foobarbang])
コード例 #2
0
ファイル: test_as.py プロジェクト: dbew/treebeard
def test_as_list_converts_to_empty_list_when_less_than_one_wildcard_left_free(example_path, example_wildcarded_context):
    a = as_list(example_path['%i'].bar.baz)
    res = a._convert(example_wildcarded_context)
    assert res == []
コード例 #3
0
ファイル: test_as_and_rel.py プロジェクト: dbew/treebeard
def test_as_list_with_relative_path_converts_to_list_of_values(example_context):
    a = as_list(up(2)["%i"].bar["%j"])
    result = a._convert(example_context)
    assert isinstance(result, list)
    assert sorted(result) == sorted([sentinel.foobarbaz, sentinel.moobarbaz, sentinel.foobarbang])