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

Source Code for Module translate.filters.test_decoration

 1  #!/usr/bin/env python 
 2   
 3  """tests decoration handling functions that are used by checks""" 
 4   
 5  from translate.filters import decoration 
 6   
7 -def test_find_marked_variables():
8 """check that we cna identify variables correctly, first value is start location, i 9 second is avtual variable sans decoations""" 10 variables = decoration.findmarkedvariables("The <variable> string", "<", ">") 11 assert variables == [(4, "variable")] 12 variables = decoration.findmarkedvariables("The $variable string", "$", 1) 13 assert variables == [(4, "v")] 14 variables = decoration.findmarkedvariables("The $variable string", "$", None) 15 assert variables == [(4, "variable")] 16 variables = decoration.findmarkedvariables("The $variable string", "$", 0) 17 assert variables == [(4, "")] 18 variables = decoration.findmarkedvariables("The &variable; string", "&", ";") 19 assert variables == [(4, "variable")] 20 variables = decoration.findmarkedvariables("The &variable.variable; string", "&", ";") 21 assert variables == [(4, "variable.variable")]
22