~dholbach/help-app/1428678

« back to all changes in this revision

Viewing changes to edit-here/tests/test_translations.py

  • Committer: Daniel Holbach
  • Date: 2015-03-06 15:47:49 UTC
  • Revision ID: daniel.holbach@canonical.com-20150306154749-bvujre37qmgys2eb
make pep8 happy, export to check (internal) links in translated markdown docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import os
2
1
from unittest import TestCase
3
2
 
4
3
import translations
16
15
        for entry, first_line in po.pot_file_ob.find_title_lines():
17
16
            results += [entry.msgid == first_line]
18
17
        self.assertNotIn(False, results)
 
18
 
 
19
    def test_translated_filenames_in_markdown_links(self):
 
20
        po = self.translations.po
 
21
        for po_fn in po.langs:
 
22
            po.load_pofile(po_fn)
 
23
            pofile = po.langs[po_fn]['pofile']
 
24
            for entry in pofile.find_in_msgid('{filename}'):
 
25
                (link_msgid, link_msgstr) = \
 
26
                    pofile.find_link_in_markdown_message(entry)
 
27
                self.assertNotIn(link_msgid, link_msgstr)
 
28
                self.assertEqual(1, len(link_msgstr))
 
29
                self.assertIn(po.langs[po_fn]['gettext_code'],
 
30
                              link_msgstr[0])