diff options
author | Benjamin Schubert <contact@benschubert.me> | 2019-06-18 11:05:52 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:03 +0000 |
commit | 8bfe8dd6ad49445c900662f304072eb20f0ff606 (patch) | |
tree | 07e04ff71c848692acb8f0f2d866449672fe0031 /tests/sources | |
parent | 1aa0fb1fefa7e86586831a13200a92f6dd9bd3b4 (diff) | |
download | buildstream-8bfe8dd6ad49445c900662f304072eb20f0ff606.tar.gz |
_yaml: Remove 'node_set'. Now use __setitem__
- Implement __setitem__ on 'MappingNode'
- Implement __setitem__ on 'SequenceNode'
- Adapt all call sites to use the new calling way.
Diffstat (limited to 'tests/sources')
-rw-r--r-- | tests/sources/git.py | 16 | ||||
-rw-r--r-- | tests/sources/previous_source_access.py | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/sources/git.py b/tests/sources/git.py index 69155e02b..7ff28114c 100644 --- a/tests/sources/git.py +++ b/tests/sources/git.py @@ -785,7 +785,7 @@ def test_git_describe(cli, tmpdir, datafiles, ref_storage, tag_type): project = str(datafiles) project_config = _yaml.load(os.path.join(project, 'project.conf')) - _yaml.node_set(project_config, 'ref-storage', ref_storage) + project_config['ref-storage'] = ref_storage _yaml.dump(project_config, os.path.join(project, 'project.conf')) repofiles = os.path.join(str(tmpdir), 'repofiles') @@ -899,7 +899,7 @@ def test_git_describe_head_is_tagged(cli, tmpdir, datafiles, ref_storage, tag_ty project = str(datafiles) project_config = _yaml.load(os.path.join(project, 'project.conf')) - _yaml.node_set(project_config, 'ref-storage', ref_storage) + project_config['ref-storage'] = ref_storage _yaml.dump(project_config, os.path.join(project, 'project.conf')) repofiles = os.path.join(str(tmpdir), 'repofiles') @@ -1014,7 +1014,7 @@ def test_git_describe_relevant_history(cli, tmpdir, datafiles): project = str(datafiles) project_config = _yaml.load(os.path.join(project, 'project.conf')) - _yaml.node_set(project_config, 'ref-storage', 'project.refs') + project_config['ref-storage'] = 'project.refs' _yaml.dump(project_config, os.path.join(project, 'project.conf')) repofiles = os.path.join(str(tmpdir), 'repofiles') @@ -1094,7 +1094,7 @@ def test_default_do_not_track_tags(cli, tmpdir, datafiles): project = str(datafiles) project_config = _yaml.load(os.path.join(project, 'project.conf')) - _yaml.node_set(project_config, 'ref-storage', 'inline') + project_config['ref-storage'] = 'inline' _yaml.dump(project_config, os.path.join(project, 'project.conf')) repofiles = os.path.join(str(tmpdir), 'repofiles') @@ -1151,17 +1151,17 @@ def test_overwrite_rogue_tag_multiple_remotes(cli, tmpdir, datafiles): repodir, reponame = os.path.split(repo.repo) project_config = _yaml.load(os.path.join(project, 'project.conf')) - _yaml.node_set(project_config, 'aliases', _yaml.new_node_from_dict({ + project_config['aliases'] = _yaml.new_node_from_dict({ 'repo': 'http://example.com/' - })) - _yaml.node_set(project_config, 'mirrors', [ + }) + project_config['mirrors'] = [ { 'name': 'middle-earth', 'aliases': { 'repo': ['file://{}/'.format(repodir)] } } - ]) + ] _yaml.dump(project_config, os.path.join(project, 'project.conf')) repo.add_annotated_tag('tag', 'tag') diff --git a/tests/sources/previous_source_access.py b/tests/sources/previous_source_access.py index 50bfe383c..916cd5a6f 100644 --- a/tests/sources/previous_source_access.py +++ b/tests/sources/previous_source_access.py @@ -25,7 +25,7 @@ def test_custom_transform_source(cli, datafiles): project_config_path = os.path.join(project, "project.conf") project_config = _yaml.load(project_config_path) aliases = project_config.get_mapping("aliases") - _yaml.node_set(aliases, "project_dir", "file://{}".format(project)) + aliases["project_dir"] = "file://{}".format(project) _yaml.dump(project_config, project_config_path) # Ensure we can track |