julen / translate forked from egparedes/translate

Toolkit assisting in the localization of software

This URL has Read+Write access

julen (author)
Sat Nov 22 04:54:00 -0800 2008
commit  e05b7b25a7dc733353b233b66ed4789bc6b78000
tree    2f35d4167f20124a704660e993e241f231ced101
parent  24c466f4605dc7f61b1fc4d02b9a312e1dc81aee
translate / tools / test_podebug.py
100644 39 lines (28 sloc) 1.266 kb
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
# -*- coding: utf-8 -*-
 
from translate.tools import podebug
from translate.storage import base
 
class TestPODebug:
 
    debug = podebug.podebug()
 
    def test_ignore_gtk(self):
        """Test operation of GTK message ignoring"""
        unit = base.TranslationUnit("default:LTR")
        assert self.debug.ignore_gtk(unit) == True
 
    def test_rewrite_blank(self):
        """Test the blank rewrite function"""
        assert self.debug.rewrite_blank("Test") == ""
 
    def test_rewrite_en(self):
        """Test the en rewrite function"""
        assert self.debug.rewrite_en("Test") == "Test"
 
    def test_rewrite_xxx(self):
        """Test the xxx rewrite function"""
        assert self.debug.rewrite_xxx("Test") == "xxxTestxxx"
        assert self.debug.rewrite_xxx("Newline\n") == "xxxNewlinexxx\n"
 
    def test_rewrite_unicode(self):
        """Test the unicode rewrite function"""
        assert self.debug.rewrite_unicode("Test") == u"Ŧḗşŧ"
 
    def test_rewrite_chef(self):
        """Test the chef rewrite function
This is not realy critical to test but a simple tests ensures
that it stays working.
"""
        assert self.debug.rewrite_chef("Mock Swedish test you muppet") == "Mock Swedish test yooo mooppet"