summaryrefslogtreecommitdiff
path: root/tests/sourcecache
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-28 17:01:23 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:03 +0000
commitf7b461220ec2f1af3966ace12c21334f1f3b6457 (patch)
tree2a3bb23cb1f26aa55fac6d5df2f95fb862755685 /tests/sourcecache
parent9e5facfab87268a80cb02f2de87897764a416c8a (diff)
downloadbuildstream-f7b461220ec2f1af3966ace12c21334f1f3b6457.tar.gz
tests: Change all calls to _yaml.dump to _yaml.rountrip_dump
Now that both are equivalent, we can skip the sanitization part before the yaml call.
Diffstat (limited to 'tests/sourcecache')
-rw-r--r--tests/sourcecache/cache.py2
-rw-r--r--tests/sourcecache/config.py2
-rw-r--r--tests/sourcecache/fetch.py12
-rw-r--r--tests/sourcecache/push.py14
4 files changed, 15 insertions, 15 deletions
diff --git a/tests/sourcecache/cache.py b/tests/sourcecache/cache.py
index 793344ef0..9aa2c67ac 100644
--- a/tests/sourcecache/cache.py
+++ b/tests/sourcecache/cache.py
@@ -96,7 +96,7 @@ def test_source_cache_key(cli, datafiles):
}
]
}
- _yaml.dump(element, os.path.join(element_path, element_name))
+ _yaml.roundtrip_dump(element, os.path.join(element_path, element_name))
res = cli.run(project=project_dir, args=["source", "track", element_name])
res.assert_success()
diff --git a/tests/sourcecache/config.py b/tests/sourcecache/config.py
index 7c33adbe0..2ab11e9f9 100644
--- a/tests/sourcecache/config.py
+++ b/tests/sourcecache/config.py
@@ -53,7 +53,7 @@ def test_missing_certs(cli, datafiles, config_key, config_value):
}
}
project_conf_file = os.path.join(project, 'project.conf')
- _yaml.dump(project_conf, project_conf_file)
+ _yaml.roundtrip_dump(project_conf, project_conf_file)
# Use `pull` here to ensure we try to initialize the remotes, triggering the error
#
diff --git a/tests/sourcecache/fetch.py b/tests/sourcecache/fetch.py
index de8587862..300f0c84c 100644
--- a/tests/sourcecache/fetch.py
+++ b/tests/sourcecache/fetch.py
@@ -56,7 +56,7 @@ def test_source_fetch(cli, tmpdir, datafiles):
},
'cachedir': cache_dir,
}
- _yaml.dump(user_config, filename=user_config_file)
+ _yaml.roundtrip_dump(user_config, file=user_config_file)
cli.configure(user_config)
repo = create_repo('git', str(tmpdir))
@@ -67,7 +67,7 @@ def test_source_fetch(cli, tmpdir, datafiles):
'kind': 'import',
'sources': [repo.source_config(ref=ref)]
}
- _yaml.dump(element, os.path.join(element_path, element_name))
+ _yaml.roundtrip_dump(element, os.path.join(element_path, element_name))
context = Context()
context.load(config=user_config_file)
@@ -138,7 +138,7 @@ def test_fetch_fallback(cli, tmpdir, datafiles):
},
'cachedir': cache_dir,
}
- _yaml.dump(user_config, filename=user_config_file)
+ _yaml.roundtrip_dump(user_config, file=user_config_file)
cli.configure(user_config)
repo = create_repo('git', str(tmpdir))
@@ -149,7 +149,7 @@ def test_fetch_fallback(cli, tmpdir, datafiles):
'kind': 'import',
'sources': [repo.source_config(ref=ref)]
}
- _yaml.dump(element, os.path.join(element_path, element_name))
+ _yaml.roundtrip_dump(element, os.path.join(element_path, element_name))
context = Context()
context.load(config=user_config_file)
@@ -195,7 +195,7 @@ def test_pull_fail(cli, tmpdir, datafiles):
},
'cachedir': cache_dir,
}
- _yaml.dump(user_config, filename=user_config_file)
+ _yaml.roundtrip_dump(user_config, file=user_config_file)
cli.configure(user_config)
repo = create_repo('git', str(tmpdir))
@@ -206,7 +206,7 @@ def test_pull_fail(cli, tmpdir, datafiles):
'kind': 'import',
'sources': [repo.source_config(ref=ref)]
}
- _yaml.dump(element, os.path.join(element_path, element_name))
+ _yaml.roundtrip_dump(element, os.path.join(element_path, element_name))
# get the source object
context = Context()
diff --git a/tests/sourcecache/push.py b/tests/sourcecache/push.py
index 23f5f1ca1..e9c72d47c 100644
--- a/tests/sourcecache/push.py
+++ b/tests/sourcecache/push.py
@@ -56,7 +56,7 @@ def test_source_push(cli, tmpdir, datafiles):
},
'cachedir': cache_dir,
}
- _yaml.dump(user_config, filename=user_config_file)
+ _yaml.roundtrip_dump(user_config, file=user_config_file)
cli.configure(user_config)
repo = create_repo('git', str(tmpdir))
@@ -67,7 +67,7 @@ def test_source_push(cli, tmpdir, datafiles):
'kind': 'import',
'sources': [repo.source_config(ref=ref)]
}
- _yaml.dump(element, os.path.join(element_path, element_name))
+ _yaml.roundtrip_dump(element, os.path.join(element_path, element_name))
# get the source object
context = Context()
@@ -116,7 +116,7 @@ def test_push_pull(cli, datafiles, tmpdir):
},
'cachedir': cache_dir,
}
- _yaml.dump(user_config, filename=user_config_file)
+ _yaml.roundtrip_dump(user_config, file=user_config_file)
cli.configure(user_config)
# create repo to pull from
@@ -128,7 +128,7 @@ def test_push_pull(cli, datafiles, tmpdir):
'kind': 'import',
'sources': [repo.source_config(ref=ref)]
}
- _yaml.dump(element, os.path.join(element_path, element_name))
+ _yaml.roundtrip_dump(element, os.path.join(element_path, element_name))
res = cli.run(project=project_dir, args=['build', 'push.bst'])
res.assert_success()
@@ -162,7 +162,7 @@ def test_push_fail(cli, tmpdir, datafiles):
},
'cachedir': cache_dir,
}
- _yaml.dump(user_config, filename=user_config_file)
+ _yaml.roundtrip_dump(user_config, file=user_config_file)
cli.configure(user_config)
# create repo to pull from
@@ -174,7 +174,7 @@ def test_push_fail(cli, tmpdir, datafiles):
'kind': 'import',
'sources': [repo.source_config(ref=ref)]
}
- _yaml.dump(element, os.path.join(element_path, element_name))
+ _yaml.roundtrip_dump(element, os.path.join(element_path, element_name))
# build and check that it fails to set up the remote
res = cli.run(project=project_dir, args=['build', 'push.bst'])
@@ -212,7 +212,7 @@ def test_source_push_build_fail(cli, tmpdir, datafiles):
'kind': 'always_fail',
'sources': [repo.source_config(ref=ref)]
}
- _yaml.dump(element, os.path.join(element_path, element_name))
+ _yaml.roundtrip_dump(element, os.path.join(element_path, element_name))
res = cli.run(project=project_dir, args=['build', 'always-fail.bst'])
res.assert_main_error(ErrorDomain.STREAM, None)