-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmointextiletests.py
executable file
·33 lines (24 loc) · 1.13 KB
/
mointextiletests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python
"""
Tests for the mointextile plugin.
@copyright: 2011 by Andrei Mackenzie
@license: GNU GPL
"""
import unittest
import mointextile
class TextileTester(unittest.TestCase):
"""Tests for mointextile.Textiler"""
def test_http(self):
"""Test the default 'http' class"""
result = mointextile.Parser.get_processed('"Andrei Mackenzie":http://www.andreimackenzie.com')
self.assertEqual('\t<p><a href="http://www.andreimackenzie.com" class="http">Andrei Mackenzie</a></p>', result)
def test_existing_class(self):
"""Test that existing classes are not overwritten"""
result = mointextile.Parser.get_processed('"(testA,testB)title":http://www.google.com')
self.assertEqual('\t<p><a href="http://www.google.com" class="testA,testB">title</a></p>', result)
def test_mailto(self):
"""Test mailto links"""
result = mointextile.Parser.get_processed('"address":mailto:[email protected]')
self.assertEqual('\t<p><a href="mailto:[email protected]" class="mailto">address</a></p>', result)
if __name__ == '__main__':
unittest.main()