diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/artifactcache/junctions.py | 4 | ||||
-rw-r--r-- | tests/elements/filter/basic/element_plugins/dynamic.py | 2 | ||||
-rw-r--r-- | tests/internals/yaml.py | 6 | ||||
-rw-r--r-- | tests/sources/git.py | 16 | ||||
-rw-r--r-- | tests/sources/previous_source_access.py | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/tests/artifactcache/junctions.py b/tests/artifactcache/junctions.py index 52d721baf..58a23fca1 100644 --- a/tests/artifactcache/junctions.py +++ b/tests/artifactcache/junctions.py @@ -31,10 +31,10 @@ def assert_shared(cli, share, project_name, project, element_name): def project_set_artifacts(project, url): project_conf_file = os.path.join(project, 'project.conf') project_config = _yaml.load(project_conf_file) - _yaml.node_set(project_config, 'artifacts', { + project_config['artifacts'] = { 'url': url, 'push': True - }) + } _yaml.dump(_yaml.node_sanitize(project_config), filename=project_conf_file) diff --git a/tests/elements/filter/basic/element_plugins/dynamic.py b/tests/elements/filter/basic/element_plugins/dynamic.py index b4a556244..eb462ceb1 100644 --- a/tests/elements/filter/basic/element_plugins/dynamic.py +++ b/tests/elements/filter/basic/element_plugins/dynamic.py @@ -25,7 +25,7 @@ class DynamicElement(Element): dep.stage_artifact(sandbox) bstdata = self.get_public_data("bst") - self.node_set_member(bstdata, "split-rules", self.split_rules) + bstdata["split-rules"] = self.split_rules self.set_public_data("bst", bstdata) return "" diff --git a/tests/internals/yaml.py b/tests/internals/yaml.py index 2f87d471b..4fb46cd89 100644 --- a/tests/internals/yaml.py +++ b/tests/internals/yaml.py @@ -127,7 +127,7 @@ def test_node_set(datafiles): base = _yaml.load(filename) assert 'mother' not in base - _yaml.node_set(base, 'mother', 'snow white') + base['mother'] = 'snow white' assert base.get_scalar('mother').as_str() == 'snow white' @@ -142,12 +142,12 @@ def test_node_set_overwrite(datafiles): # Overwrite a string assert base.get_scalar('kind').as_str() == 'pony' - _yaml.node_set(base, 'kind', 'cow') + base['kind'] = 'cow' assert base.get_scalar('kind').as_str() == 'cow' # Overwrite a list as a string assert _yaml.node_get(base, list, 'moods') == ['happy', 'sad'] - _yaml.node_set(base, 'moods', 'unemotional') + base['moods'] = 'unemotional' assert base.get_scalar('moods').as_str() == 'unemotional' diff --git a/tests/sources/git.py b/tests/sources/git.py index e4c6111f1..25da5c225 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(_yaml.node_sanitize(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(_yaml.node_sanitize(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(_yaml.node_sanitize(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(_yaml.node_sanitize(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(_yaml.node_sanitize(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 |