diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-28 17:01:23 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:03 +0000 |
commit | f7b461220ec2f1af3966ace12c21334f1f3b6457 (patch) | |
tree | 2a3bb23cb1f26aa55fac6d5df2f95fb862755685 /tests/artifactcache | |
parent | 9e5facfab87268a80cb02f2de87897764a416c8a (diff) | |
download | buildstream-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/artifactcache')
-rw-r--r-- | tests/artifactcache/cache_size.py | 4 | ||||
-rw-r--r-- | tests/artifactcache/config.py | 6 | ||||
-rw-r--r-- | tests/artifactcache/junctions.py | 2 | ||||
-rw-r--r-- | tests/artifactcache/pull.py | 4 | ||||
-rw-r--r-- | tests/artifactcache/push.py | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/tests/artifactcache/cache_size.py b/tests/artifactcache/cache_size.py index 3a2956c5c..fb34b5fad 100644 --- a/tests/artifactcache/cache_size.py +++ b/tests/artifactcache/cache_size.py @@ -22,7 +22,7 @@ def create_project(project_dir): project_conf = { "name": "test" } - _yaml.dump(project_conf, project_file) + _yaml.roundtrip_dump(project_conf, project_file) element_name = "test.bst" create_element_size(element_name, project_dir, ".", [], 1024) @@ -77,7 +77,7 @@ def test_quota_over_1024T(cli, tmpdir): }) project = tmpdir.join("main") os.makedirs(str(project)) - _yaml.dump({'name': 'main'}, str(project.join("project.conf"))) + _yaml.roundtrip_dump({'name': 'main'}, str(project.join("project.conf"))) volume_space_patch = mock.patch( "buildstream._cas.CASQuota._get_cache_volume_size", diff --git a/tests/artifactcache/config.py b/tests/artifactcache/config.py index 928a6c524..db51d196c 100644 --- a/tests/artifactcache/config.py +++ b/tests/artifactcache/config.py @@ -101,11 +101,11 @@ def test_artifact_cache_precedence(tmpdir, override_caches, project_caches, user project_config['name'] = 'test' user_config_file = str(tmpdir.join('buildstream.conf')) - _yaml.dump(user_config, filename=user_config_file) + _yaml.roundtrip_dump(user_config, file=user_config_file) project_dir = tmpdir.mkdir('project') project_config_file = str(project_dir.join('project.conf')) - _yaml.dump(project_config, filename=project_config_file) + _yaml.roundtrip_dump(project_config, file=project_config_file) context = Context() context.load(config=user_config_file) @@ -141,7 +141,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/artifactcache/junctions.py b/tests/artifactcache/junctions.py index f099ee566..6170816c3 100644 --- a/tests/artifactcache/junctions.py +++ b/tests/artifactcache/junctions.py @@ -24,7 +24,7 @@ def project_set_artifacts(project, url): 'url': url, 'push': True } - _yaml.dump(project_config, filename=project_conf_file) + _yaml.roundtrip_dump(project_config.strip_node_info(), file=project_conf_file) @pytest.mark.datafiles(DATA_DIR) diff --git a/tests/artifactcache/pull.py b/tests/artifactcache/pull.py index a4ea74633..72f3103f0 100644 --- a/tests/artifactcache/pull.py +++ b/tests/artifactcache/pull.py @@ -73,7 +73,7 @@ def test_pull(cli, tmpdir, datafiles): } # Write down the user configuration file - _yaml.dump(user_config, filename=user_config_file) + _yaml.roundtrip_dump(user_config, file=user_config_file) # Ensure CLI calls will use it cli.configure(user_config) @@ -182,7 +182,7 @@ def test_pull_tree(cli, tmpdir, datafiles): } # Write down the user configuration file - _yaml.dump(user_config, filename=user_config_file) + _yaml.roundtrip_dump(user_config, file=user_config_file) # Ensure CLI calls will use it cli.configure(user_config) diff --git a/tests/artifactcache/push.py b/tests/artifactcache/push.py index a54c1df09..9b976c490 100644 --- a/tests/artifactcache/push.py +++ b/tests/artifactcache/push.py @@ -66,7 +66,7 @@ def test_push(cli, tmpdir, datafiles): } # Write down the user configuration file - _yaml.dump(user_config, filename=user_config_file) + _yaml.roundtrip_dump(user_config, file=user_config_file) # Fake minimal context context = Context() @@ -164,7 +164,7 @@ def test_push_message(tmpdir, datafiles): } # Write down the user configuration file - _yaml.dump(user_config, filename=user_config_file) + _yaml.roundtrip_dump(user_config, file=user_config_file) queue = multiprocessing.Queue() # Use subprocess to avoid creation of gRPC threads in main BuildStream process |