This repository has been archived by the owner on May 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconverterTest.py
41 lines (28 loc) · 1.71 KB
/
converterTest.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
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
import unittest
from converter import Converter
class TestConverter(unittest.TestCase):
def testConvertNothing(self):
assert converter.convert('') == ''
def testConvertSomethingSimple(self):
assert converter.convert('A simple url: www.google.com') == 'A simple url: www.google.com'
def testConvertHtmlName(self):
assert converter.convert('Grégory Paul') == 'Grégory Paul'.decode('utf8')
# Title from http://www.necdisplay.com/NewTechnologies/CurvedDisplay/
def testConvertRaquo(self):
assert converter.convert('NEC Display Solutions » News & Media » Media Coverage') == 'NEC Display Solutions \' News and Media \' Media Coverage'
# Title from http://tempsreel.nouvelobs.com/actualites/societe/20091013.OBS4458/
def testConvertAccents(self):
assert converter.convert('Trois cas de gale ont été signalés à l\'Elysée, Société') == 'Trois cas de gale ont été signalés à l\'Elysée, Société'.decode('utf8')
# Title from http://stackoverflow.com/questions/1594261/
def testConvertTags(self):
assert converter.convert('Remove visability on <li> tags except (this) on hover in a menu') == 'Remove visability on {li} tags except (this) on hover in a menu'
def testConvertTags(self):
assert converter.convert('multi\r\nline') == 'multi line'
def testConvertTags(self):
assert converter.convert('tab\tother tab') == 'tab other tab'
def testConvertAccents(self):
assert converter.convert('test de commentaire avec accent : éèêîô') == 'test de commentaire avec accent : éèêîô'.decode('utf8')
if __name__=="__main__":
converter = Converter()
unittest.main()