Skip to content

Commit a51c36a

Browse files
committed
Structural decorator test suite
1 parent 789b69d commit a51c36a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/test_decorator.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
import unittest
4+
from structural.decorator import TextTag, BoldWrapper, ItalicWrapper
5+
6+
7+
class TestTextWrapping(unittest.TestCase):
8+
9+
def setUp(self):
10+
self.raw_string = TextTag('raw but not cruel')
11+
12+
def test_italic(self):
13+
self.assertEqual(ItalicWrapper(self.raw_string).render(),
14+
'<i>raw but not cruel</i>')
15+
16+
def test_bold(self):
17+
self.assertEqual(BoldWrapper(self.raw_string).render(),
18+
'<b>raw but not cruel</b>')
19+
20+
def test_mixed_bold_and_italic(self):
21+
self.assertEqual(
22+
BoldWrapper(ItalicWrapper(self.raw_string)).render(),
23+
'<b><i>raw but not cruel</i></b>')
24+

0 commit comments

Comments
 (0)