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.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.py')
-rw-r--r-- | tests/format/include.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/format/include.py b/tests/format/include.py index 8902aa3eb..434a94d1f 100644 --- a/tests/format/include.py +++ b/tests/format/include.py @@ -197,7 +197,7 @@ def test_include_element_overrides_composition(cli, datafiles): 'element.bst']) result.assert_success() loaded = _yaml.load_data(result.output) - assert loaded.get_sequence('build-commands').as_str_list() == ['first', 'second'] + assert loaded.get_str_list('build-commands') == ['first', 'second'] @pytest.mark.datafiles(DATA_DIR) @@ -215,7 +215,7 @@ def test_list_overide_does_not_fail_upon_first_composition(cli, datafiles): # Assert that the explicitly overwritten public data is present bst = loaded.get_mapping('bst') assert 'foo-commands' in bst - assert bst.get_sequence('foo-commands').as_str_list() == ['need', 'this'] + assert bst.get_str_list('foo-commands') == ['need', 'this'] @pytest.mark.datafiles(DATA_DIR) |