diff options
author | Benjamin Schubert <contact@benschubert.me> | 2019-06-25 21:14:40 +0100 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-27 15:08:11 +0100 |
commit | 4e66ca802766545084018441b2a2ddda81c34f2f (patch) | |
tree | 6b1c532cb502a78ca769d73c71ddbf724dad3d08 /tests/frontend/project/sources/fetch_source.py | |
parent | 4652bfa0cbd86bdf24dae416b75c2607e5edcd41 (diff) | |
download | buildstream-bschubert/node-api-keys.tar.gz |
_yaml: Remove 'node_items' and add 'MappingNode.items()'bschubert/node-api-keys
One difference is that 'MappingNode.items()' does not strip the
provenance from scalars and lists, which ends up not affecting the
code much.
Diffstat (limited to 'tests/frontend/project/sources/fetch_source.py')
-rw-r--r-- | tests/frontend/project/sources/fetch_source.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/frontend/project/sources/fetch_source.py b/tests/frontend/project/sources/fetch_source.py index 7c0df4595..ead5bc3f5 100644 --- a/tests/frontend/project/sources/fetch_source.py +++ b/tests/frontend/project/sources/fetch_source.py @@ -40,11 +40,10 @@ class FetchSource(Source): def configure(self, node): self.original_urls = node.get_sequence('urls').as_str_list() self.output_file = node.get_str('output-text') - self.fetch_succeeds = {} - if 'fetch-succeeds' in node: - fetch_succeeds_node = node.get_mapping('fetch-succeeds') - for key, value in self.node_items(fetch_succeeds_node): - self.fetch_succeeds[key] = value in ('True', 'true') + self.fetch_succeeds = { + key: value.as_bool() + for key, value in node.get_mapping('fetch-succeeds', {}).items() + } # First URL is the primary one for this test # |