def test_case3(self): """Test for double quotes.""" content = 'msgid "test"\n' \ 'msgstr "Esto es una \\"prueba\\""\n' po = POFile() po.load_state_from_string(content) self.assertEqual(po.get_msgstr('test'), u'Esto es una "prueba"')
def test_case3(self): """Test for double quotes.""" content = 'msgid "test"\n' \ 'msgstr "Esto es una \\"prueba\\""\n' po = POFile() po.load_state_from_string(content) self.assertEqual(po.get_msgstr('test'), u'Esto es una "prueba"')
def test_case1(self): """Test for newlines.""" content = 'msgid "Add"\n' \ 'msgstr "Ajouter\\n"\n' po = POFile() po.load_state_from_string(content) self.assertEqual(po.get_msgstr('Add'), u'Ajouter\n')
def test_case1(self): """Test for newlines.""" content = 'msgid "Add"\n' \ 'msgstr "Ajouter\\n"\n' po = POFile() po.load_state_from_string(content) self.assertEqual(po.get_msgstr('Add'), u'Ajouter\n')
def test_end_comment(self): """Test end comment.""" content = '#, fuzzy\n' \ '#~ msgid "Hello"\n' \ '#~ msgstr "Hola"\n' po = POFile() po.load_state_from_string(content) translation = po.gettext(((TEXT, 'Hello'), )) self.assertEqual(translation, ((TEXT, 'Hello'), ))
def test_case2(self): """Test for multiple lines.""" content = 'msgid "Hello world"\n' \ 'msgstr ""\n' \ '"Hola "\n' \ '"mundo"\n' po = POFile() po.load_state_from_string(content) self.assertEqual(po.get_msgstr('Hello world'), u'Hola mundo')
def test_end_comment(self): """Test end comment.""" content = '#, fuzzy\n' \ '#~ msgid "Hello"\n' \ '#~ msgstr "Hola"\n' po = POFile() po.load_state_from_string(content) translation = po.gettext(((TEXT, 'Hello'),)) self.assertEqual(translation,((TEXT, 'Hello'),))
def test_case2(self): """Test for multiple lines.""" content = 'msgid "Hello world"\n' \ 'msgstr ""\n' \ '"Hola "\n' \ '"mundo"\n' po = POFile() po.load_state_from_string(content) self.assertEqual(po.get_msgstr('Hello world'), u'Hola mundo')
def test_output(self): """Test output.""" content = '# Comment\n' \ '#: pouet.py:45\n' \ '#, fuzzy\n' \ 'msgid "Hello"\n' \ 'msgstr ""\n' \ '"Hola\\n"\n' po = POFile() po.load_state_from_string(content) self.assertEqual((po.get_units())[0].to_str(), content)
def test_output(self): """Test output.""" content = '# Comment\n' \ '#: pouet.py:45\n' \ '#, fuzzy\n' \ 'msgid "Hello"\n' \ 'msgstr ""\n' \ '"Hola\\n"\n' po = POFile() po.load_state_from_string(content) self.assertEqual((po.get_units())[0].to_str(), content)
def test_fuzzy(self): """Test fuzzy.""" content = '# Comment\n' \ '#: pouet.py:45\n' \ '#, fuzzy\n' \ 'msgid "Hello"\n' \ 'msgstr ""\n' \ '"Hola\\n"\n' po = POFile() po.load_state_from_string(content) translation = po.gettext(((TEXT, 'Hello'), )) self.assertEqual(translation, ((TEXT, 'Hello'), ))
def test_fuzzy(self): """Test fuzzy.""" content = '# Comment\n' \ '#: pouet.py:45\n' \ '#, fuzzy\n' \ 'msgid "Hello"\n' \ 'msgstr ""\n' \ '"Hola\\n"\n' po = POFile() po.load_state_from_string(content) translation = po.gettext(((TEXT, 'Hello'),)) self.assertEqual(translation, ((TEXT, 'Hello'),))