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
20 lines
606 B
Python
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')
|