summaryrefslogtreecommitdiff
path: root/src/leap/util/tests/test_translations.py
blob: 794daebac24492cca5978c6c5cf5b3175b3c8851 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import unittest

from leap.util import translations


class TrasnlationsTestCase(unittest.TestCase):
    """
    tests for translation functions and classes
    """

    def setUp(self):
        self.trClass = translations.LEAPTranslatable

    def test_trasnlatable(self):
        tr = self.trClass({"en": "house", "es": "casa"})
        eq = self.assertEqual
        eq(tr.tr(to="es"), "casa")
        eq(tr.tr(to="en"), "house")


if __name__ == "__main__":
    unittest.main()