mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-03 04:14:43 +00:00
Merge pull request #605 from cjmayo/test_po
Use existing test_po.py only
This commit is contained in:
commit
ff7e157a18
2 changed files with 7 additions and 18 deletions
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
|
|
@ -28,6 +28,7 @@ jobs:
|
|||
steps:
|
||||
- name: Install OS dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y clamav-daemon geoip-database libgeoip-dev gettext
|
||||
|
||||
- name: Download the ClamAV signature database
|
||||
|
|
@ -149,17 +150,3 @@ jobs:
|
|||
|
||||
- name: Run ${{ matrix.toxenv }}
|
||||
run: python -m tox -e ${{ matrix.toxenv }}
|
||||
|
||||
translations:
|
||||
name: Check Translations
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Git clone
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependency
|
||||
run: sudo apt install -y gettext
|
||||
|
||||
- name: Compile translations
|
||||
run: for po in po/*.po; do msgfmt -cv --statistics -o - ${po} >/dev/null; done
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test gettext .po files.
|
|||
"""
|
||||
|
||||
import unittest
|
||||
import os
|
||||
import subprocess
|
||||
import glob
|
||||
from tests import need_msgfmt, need_posix
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ def get_pofiles():
|
|||
if pofiles is None:
|
||||
pofiles = []
|
||||
pofiles.extend(glob.glob("po/*.po"))
|
||||
pofiles.extend(glob.glob("doc/*.po"))
|
||||
pofiles.extend(glob.glob("doc/i18n/locales/**/*.po", recursive=True))
|
||||
if not pofiles:
|
||||
raise Exception("No .po files found")
|
||||
return pofiles
|
||||
|
|
@ -47,8 +47,10 @@ class TestPo(unittest.TestCase):
|
|||
def test_pos(self):
|
||||
"""Test .po files syntax."""
|
||||
for f in get_pofiles():
|
||||
ret = os.system("msgfmt -c -o - %s > /dev/null" % f)
|
||||
self.assertEqual(ret, 0, msg="PO-file syntax error in %r" % f)
|
||||
cp = subprocess.run(["msgfmt", "-c", "-o", "-", f], capture_output=True)
|
||||
self.assertEqual(
|
||||
cp.returncode, 0,
|
||||
msg=f"PO-file syntax error in {f!r}: {str(cp.stderr, 'utf-8')}")
|
||||
|
||||
|
||||
class TestGTranslator(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Reference in a new issue