kiwi-el8/test/unit/markup/markup_test.py
Marcus Schäfer 8172f96186
Refactor Markup
This commit refactors the Markup class and turns it into a proper
factory class which also include type hints to facilitate it's
use from an API POV. Related to #1498
2020-11-23 13:02:44 +01:00

20 lines
626 B
Python

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