diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-13 18:54:28 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:02 +0000 |
commit | 50335363cd49e7945567609cf8b1273576b27667 (patch) | |
tree | 4dbe6507e8c39ce37f228bb1f007f075bca6e6cf /src/buildstream/testing/_sourcetests | |
parent | 95a6e2d03157da46f9056956111847989326e3db (diff) | |
download | buildstream-50335363cd49e7945567609cf8b1273576b27667.tar.gz |
_yaml: Remove 'node_get' and migrate all remaining calls to new API
Diffstat (limited to 'src/buildstream/testing/_sourcetests')
-rw-r--r-- | src/buildstream/testing/_sourcetests/mirror.py | 8 | ||||
-rw-r--r-- | src/buildstream/testing/_sourcetests/track.py | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/buildstream/testing/_sourcetests/mirror.py b/src/buildstream/testing/_sourcetests/mirror.py index d682bb2ef..afbadbef7 100644 --- a/src/buildstream/testing/_sourcetests/mirror.py +++ b/src/buildstream/testing/_sourcetests/mirror.py @@ -357,9 +357,9 @@ def test_mirror_track_upstream_present(cli, tmpdir, datafiles, kind): # Tracking tries upstream first. Check the ref is from upstream. new_element = _yaml.load(element_path) - source = _yaml.node_get(new_element, dict, 'sources', [0]) + source = new_element.get_sequence('sources').mapping_at(0) if 'ref' in source: - assert _yaml.node_get(source, str, 'ref') == upstream_ref + assert source.get_str('ref') == upstream_ref @pytest.mark.datafiles(DATA_DIR) @@ -422,6 +422,6 @@ def test_mirror_track_upstream_absent(cli, tmpdir, datafiles, kind): # Check that tracking fell back to the mirror new_element = _yaml.load(element_path) - source = _yaml.node_get(new_element, dict, 'sources', [0]) + source = new_element.get_sequence('sources').mapping_at(0) if 'ref' in source: - assert _yaml.node_get(source, str, 'ref') == mirror_ref + assert source.get_str('ref') == mirror_ref diff --git a/src/buildstream/testing/_sourcetests/track.py b/src/buildstream/testing/_sourcetests/track.py index 668ea29e5..08173e79b 100644 --- a/src/buildstream/testing/_sourcetests/track.py +++ b/src/buildstream/testing/_sourcetests/track.py @@ -321,13 +321,13 @@ def test_track_include(cli, tmpdir, datafiles, ref_storage, kind): # Get all of the sources assert 'sources' in new_sources - sources_list = _yaml.node_get(new_sources, list, 'sources') + sources_list = new_sources.get_sequence('sources') assert len(sources_list) == 1 # Get the first source from the sources list - new_source = _yaml.node_get(new_sources, dict, 'sources', indices=[0]) + new_source = sources_list.mapping_at(0) assert 'ref' in new_source - assert ref == _yaml.node_get(new_source, str, 'ref') + assert ref == new_source.get_scalar('ref').as_str() @pytest.mark.datafiles(DATA_DIR) |