summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2022-01-27 11:13:56 +0100
committerDominik Holland <dominik.holland@googlemail.com>2022-01-27 13:50:04 +0100
commit1dd848a53e7191914e3ebaabceb07ba66070bd35 (patch)
treeaa5ea0d68cc966edf9f70911a63278510fd3ea3e /tests
parent3703c77aa9014aeff71ea455710cc627cd5c562c (diff)
downloadqtivi-qface-upstream/master.tar.gz
Don't report an error when parsing an empty annotations fileHEADupstream/master
Fixes: #64
Diffstat (limited to 'tests')
-rw-r--r--tests/in/empty_tuner_annotations.yaml0
-rw-r--r--tests/test_tags.py10
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/in/empty_tuner_annotations.yaml b/tests/in/empty_tuner_annotations.yaml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/in/empty_tuner_annotations.yaml
diff --git a/tests/test_tags.py b/tests/test_tags.py
index 0e70143..be9483c 100644
--- a/tests/test_tags.py
+++ b/tests/test_tags.py
@@ -69,6 +69,16 @@ def test_merge_annotation():
assert interface.attribute('extra', 'extraA') is True
@patch('sys.stderr', new_callable=StringIO)
+def test_merge_empty_annotation(mock_stderr):
+ system = loadTuner()
+ interface = system.lookup('com.pelagicore.ivi.tuner.Tuner')
+ assert interface
+ FileSystem.merge_annotations(system, inputPath / 'empty_tuner_annotations.yaml')
+
+ assert interface.attribute('extra', 'extraA') is None
+ assert not mock_stderr.getvalue().__contains__("Error parsing annotation")
+
+@patch('sys.stderr', new_callable=StringIO)
def test_merge_broken_annotation(mock_stderr):
system = loadTuner()
interface = system.lookup('com.pelagicore.ivi.tuner.Tuner')