Package translate :: Package filters :: Module test_prefilters
[hide private]
[frames] | no frames]

Source Code for Module translate.filters.test_prefilters

 1  #!/usr/bin/env python 
 2  # -*- coding: utf-8 -*- 
 3   
 4  """tests decoration handling functions that are used by checks""" 
 5   
 6  from translate.filters import prefilters 
 7   
8 -def test_filterwordswithpunctuation():
9 string = "Nothing in here." 10 filtered = prefilters.filterwordswithpunctuation(string) 11 assert filtered == string 12 # test listed words (start / end with apostrophe) 13 string = "'n Boom het 'n tak." 14 filtered = prefilters.filterwordswithpunctuation(string) 15 assert filtered == "n Boom het n tak." 16 # test words containing apostrophe 17 string = "It's in it's own place." 18 filtered = prefilters.filterwordswithpunctuation(string) 19 assert filtered == "Its in its own place." 20 # test strings in unicode 21 string = u"Iṱ'š" 22 filtered = prefilters.filterwordswithpunctuation(string) 23 assert filtered == u"Iṱš"
24