File: markup_test.py

package info (click to toggle)
kiwi 10.2.41-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 7,592 kB
  • sloc: python: 69,585; sh: 4,230; xml: 3,386; ansic: 391; makefile: 360
file content (19 lines) | stat: -rw-r--r-- 635 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from unittest.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')