Skip to content

Commit

Permalink
Merge pull request #151 from jano-wol/feature/s-145-2
Browse files Browse the repository at this point in the history
Make title_test general
  • Loading branch information
anwolosz authored Nov 24, 2024
2 parents 976e676 + 1d19214 commit 7ba04f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/assets/translations/ruf.json
Original file line number Diff line number Diff line change
Expand Up @@ -14436,7 +14436,7 @@
},
{
"id": "148",
"section_title": "Jézus sok beteget meggyógyít",
"section_title": "Genezáreti gyógyítások",
"mt": [
{
"leading": true,
Expand Down Expand Up @@ -15813,7 +15813,7 @@
},
{
"id": "160",
"section_title": "Jézus követése",
"section_title": "„Ha valaki énutánam akar jönni”",
"mt": [
{
"leading": true,
Expand Down Expand Up @@ -21198,7 +21198,7 @@
},
{
"id": "235",
"section_title": "Az Emberfia eljövetele",
"section_title": "Az Emberfia napja",
"mt": [
{
"leading": false,
Expand Down
16 changes: 6 additions & 10 deletions tests/title_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from bible import evangelists
from file_utils import iterate_jsons

checked_translations = ['kg', 'esv', 'szit', 'knb', 'bt', 'bjw', 'rsp', 'nv', 'sblgnt', 'eu']
roman = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI',
'XVII', 'XVIII']

Expand Down Expand Up @@ -72,18 +71,15 @@ def check_translation(json_loaded, file_name):


def main():
file_flags = {file_name: False for file_name in checked_translations}
json_folder = sys.argv[1]
json_files_found = False
for json_loaded, json_path in iterate_jsons(json_folder):
json_files_found = True
file_name = os.path.basename(json_path)
file_base_name = os.path.splitext(file_name)[0]
if file_base_name in checked_translations:
file_flags[file_base_name] = True
check_translation(json_loaded, file_name)
for file_name, tested in file_flags.items():
if not tested:
print(f'Test fail: {file_name}.json was not tested.')
exit(1)
check_translation(json_loaded, file_name)
if not json_files_found:
print(f'No json files were found in folder={json_folder}')
sys.exit(1)


if __name__ == '__main__':
Expand Down

0 comments on commit 7ba04f0

Please sign in to comment.