diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-16 18:31:19 +0100 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-16 18:32:48 +0100 |
commit | f2ece705b7bf36d7d923264af2b1f51b66a9f9a7 (patch) | |
tree | 7df4a79b12013f6094371e86bcf52bb6aa8719e7 /tests/format/include_composition.py | |
parent | fbb8eea8334023e30c8719cb52f9b0e226b4eb8b (diff) | |
download | buildstream-bschubert/api-improvements.tar.gz |
node: Add 'get_str_list' on 'MappingNode'bschubert/api-improvements
`mapping.get_sequence(...).as_str_list()` is a very common
pattern seen both in plugins and the core. Adding a helper to reduce
the number of operations will make usage smoother
Diffstat (limited to 'tests/format/include_composition.py')
-rw-r--r-- | tests/format/include_composition.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/format/include_composition.py b/tests/format/include_composition.py index ec48d82a2..e10e28bc0 100644 --- a/tests/format/include_composition.py +++ b/tests/format/include_composition.py @@ -30,7 +30,7 @@ def test_main_has_priority(tmpdir): includes.process(main) - assert main.get_sequence('test').as_str_list() == ['main'] + assert main.get_str_list('test') == ['main'] def test_include_cannot_append(tmpdir): @@ -45,7 +45,7 @@ def test_include_cannot_append(tmpdir): includes.process(main) - assert main.get_sequence('test').as_str_list() == ['main'] + assert main.get_str_list('test') == ['main'] def test_main_can_append(tmpdir): @@ -59,7 +59,7 @@ def test_main_can_append(tmpdir): includes.process(main) - assert main.get_sequence('test').as_str_list() == ['a', 'main'] + assert main.get_str_list('test') == ['a', 'main'] def test_sibling_cannot_append_backward(tmpdir): @@ -76,7 +76,7 @@ def test_sibling_cannot_append_backward(tmpdir): includes.process(main) - assert main.get_sequence('test').as_str_list() == ['b'] + assert main.get_str_list('test') == ['b'] def test_sibling_can_append_forward(tmpdir): @@ -93,7 +93,7 @@ def test_sibling_can_append_forward(tmpdir): includes.process(main) - assert main.get_sequence('test').as_str_list() == ['a', 'b'] + assert main.get_str_list('test') == ['a', 'b'] def test_lastest_sibling_has_priority(tmpdir): @@ -110,7 +110,7 @@ def test_lastest_sibling_has_priority(tmpdir): includes.process(main) - assert main.get_sequence('test').as_str_list() == ['b'] + assert main.get_str_list('test') == ['b'] def test_main_keeps_keys(tmpdir): @@ -124,7 +124,7 @@ def test_main_keeps_keys(tmpdir): includes.process(main) - assert main.get_sequence('test').as_str_list() == ['a'] + assert main.get_str_list('test') == ['a'] assert main.get_str('something') == 'else' @@ -147,5 +147,5 @@ def test_overwrite_directive_on_later_composite(tmpdir): includes.process(main) - assert main.get_sequence('test').as_str_list() == ['Overwritten'] + assert main.get_str_list('test') == ['Overwritten'] assert main.get_str('foo') == 'should be present' |