Skip to content

Commit

Permalink
add skip logic for ublad test
Browse files Browse the repository at this point in the history
  • Loading branch information
Meesch committed Jun 18, 2024
1 parent a8bfeb1 commit d7ce070
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions backend/corpora/ublad/tests/test_ublad.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import locale
import pytest
from corpora.ublad.ublad import transform_date
import datetime
import subprocess


def test_transform_date():
# Install the Dutch language package for locale
subprocess.run(['sudo', 'apt-get', 'install', 'language-pack-nl'])
datestring = '6 september 2007'
goal_date = datetime.date(2007, 9, 6)
date = transform_date(datestring)
try:
date = transform_date(datestring)
except locale.Error:
pytest.skip('Dutch Locale not installed in environment')
assert date == str(goal_date)

0 comments on commit d7ce070

Please sign in to comment.