diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/in/empty_tuner_annotations.yaml | 0 | ||||
-rw-r--r-- | tests/test_tags.py | 10 |
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') |