summaryrefslogtreecommitdiff
path: root/tests/sources/git.py
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-10 14:20:23 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:02 +0000
commitd14b809cc7b56b7be9e3e40c2e12e8f7245ba680 (patch)
tree3afa82437bb3dcda6b63979c88c20d70f8dfd4f4 /tests/sources/git.py
parent38671fb53f4522d046bed94699db8cc344ac2862 (diff)
downloadbuildstream-d14b809cc7b56b7be9e3e40c2e12e8f7245ba680.tar.gz
_yaml: Add 'as_bool()' and 'is_none()' to ScalarNode
- 'as_bool()' casts a ScalarNode into a boolean, understanding both 'True' and 'False' as truthy-falsy values, as per node_get(type=bool) behavior - 'is_none()' allwos checking whether the scalar node contains a 'None' value. Since 'None' cannot be used when working with booleans, we need to have a way of checking for 'None' when we actually need the information of whether the value is unset. - Adapt all call places to use the new API
Diffstat (limited to 'tests/sources/git.py')
-rw-r--r--tests/sources/git.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/sources/git.py b/tests/sources/git.py
index 2b8a12997..e3f803469 100644
--- a/tests/sources/git.py
+++ b/tests/sources/git.py
@@ -855,7 +855,7 @@ def test_git_describe(cli, tmpdir, datafiles, ref_storage, tag_type):
assert 'tag' in tag
assert 'commit' in tag
assert 'annotated' in tag
- assert _yaml.node_get(tag, bool, 'annotated') == (tag_type == 'annotated')
+ assert tag.get_bool('annotated') == (tag_type == 'annotated')
assert {(tag.get_str('tag'),
tag.get_str('commit'))
@@ -970,7 +970,7 @@ def test_git_describe_head_is_tagged(cli, tmpdir, datafiles, ref_storage, tag_ty
assert 'tag' in tag
assert 'commit' in tag
assert 'annotated' in tag
- assert _yaml.node_get(tag, bool, 'annotated') == (tag_type == 'annotated')
+ assert tag.get_bool('annotated') == (tag_type == 'annotated')
tag_name = tag.get_str('tag')
commit = tag.get_str('commit')