-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |