kiwi-el8/test/unit/markup/markup_test.py
Marcus Schäfer 4720d21283
Support multiple markup formats
Allow to read multiple markup formats. Supported are XML
and YAML. The parsing and transformation is based on the
anymarkup module. The use of anymarkup is optional and
implemented as an on demand loading module. If a user
uses a yaml config file or a request to convert into
yaml is made without an installed anymarkup module an
exception is thrown
2020-05-15 13:59:22 +02:00

20 lines
606 B
Python

from mock import patch
from kiwi.markup import Markup
from kiwi.exceptions import KiwiAnyMarkupPluginError
class TestMarkup:
@patch('kiwi.markup.MarkupAny')
def test_MarkupAny(self, mock_MarkupAny):
Markup('description')
mock_MarkupAny.assert_called_once_with('description')
@patch('kiwi.markup.MarkupXML')
@patch('kiwi.markup.MarkupAny')
def test_MarkupXML(self, mock_MarkupAny, mock_MarkupXML):
mock_MarkupAny.side_effect = KiwiAnyMarkupPluginError('load-error')
Markup('description')
mock_MarkupXML.assert_called_once_with('description')