From ec0fc05e3918782dbb29f9f6901c0de22419134d Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 21 Dec 2012 10:28:46 +0900 Subject: magic translatable objects --- src/leap/util/tests/test_translations.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/leap/util/tests/test_translations.py (limited to 'src/leap/util/tests') diff --git a/src/leap/util/tests/test_translations.py b/src/leap/util/tests/test_translations.py new file mode 100644 index 00000000..794daeba --- /dev/null +++ b/src/leap/util/tests/test_translations.py @@ -0,0 +1,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() -- cgit v1.2.3