mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-13 07:56:14 +01:00
35 lines
788 B
Python
35 lines
788 B
Python
|
import unittest
|
||
|
|
||
|
from osc._private.api import xml_escape
|
||
|
|
||
|
|
||
|
class TestXmlEscape(unittest.TestCase):
|
||
|
def test_lt(self):
|
||
|
actual = xml_escape("<")
|
||
|
expected = "<"
|
||
|
self.assertEqual(actual, expected)
|
||
|
|
||
|
def test_gt(self):
|
||
|
actual = xml_escape(">")
|
||
|
expected = ">"
|
||
|
self.assertEqual(actual, expected)
|
||
|
|
||
|
def test_apos(self):
|
||
|
actual = xml_escape("'")
|
||
|
expected = "'"
|
||
|
self.assertEqual(actual, expected)
|
||
|
|
||
|
def test_quot(self):
|
||
|
actual = xml_escape("\"")
|
||
|
expected = """
|
||
|
self.assertEqual(actual, expected)
|
||
|
|
||
|
def test_amp(self):
|
||
|
actual = xml_escape("&")
|
||
|
expected = "&"
|
||
|
self.assertEqual(actual, expected)
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
unittest.main()
|