Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[WIPTEST] Some i18n testing #1453

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions cfme/tests/test_i18n.py
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
import command
import os
import pytest
import re

from utils import diaper

pytestmark = [pytest.mark.ignore_stream("5.2", "5.3")]


def test_i18n(request, random_string, ssh_client, soft_assert):
lang_dirs = filter(
lambda d: re.search(r"/[a-z]{2}$", d),
ssh_client.run_command("ls -d /var/www/miq/vmdb/config/locales/*")[-1].split("\n"))
lang_codes = map(lambda directory: re.sub(r"^.*?/([a-z]{2})$", r"\1", directory), lang_dirs)
tmpfilename = "/tmp/{}.po".format(random_string)
request.addfinalizer(lambda: diaper(lambda: os.unlink(tmpfilename)))
for lang_code in lang_codes:
ssh_client.get_file(
"/var/www/miq/vmdb/config/locales/{}/manageiq.po".format(lang_code), tmpfilename)
result = command.run(["pofilter", tmpfilename])
soft_assert(
len(result.output.strip()) == 0, "{} language test failed!".format(lang_code))
os.unlink(tmpfilename)
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -39,6 +39,7 @@ slumber
sqlalchemy
suds
tornado
translate-toolkit
tzlocal
ui-navigate
yaycl
Expand Down