summaryrefslogtreecommitdiff
path: root/tests/frontend
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-06-25 21:14:40 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:03 +0000
commit1aa0fb1fefa7e86586831a13200a92f6dd9bd3b4 (patch)
tree8e675fc215ab9f1fcf8851470c95c0e2039f42ee /tests/frontend
parent42d3d8406a15cd5f6f4a7d00e298dba019a50ed6 (diff)
downloadbuildstream-1aa0fb1fefa7e86586831a13200a92f6dd9bd3b4.tar.gz
_yaml: Remove 'node_items' and add 'MappingNode.items()'
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')
-rw-r--r--tests/frontend/project/sources/fetch_source.py9
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
#