-
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
1 parent
5867e0f
commit 391904a
Showing
3 changed files
with
38 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"python.testing.pytestArgs": [ | ||
"tests" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from datetime import time | ||
import pytest | ||
from saa.core.watch import Watch | ||
from saa.core.plugins import supported_languages | ||
|
||
German = supported_languages.get("de") | ||
|
||
test_cases = [ | ||
(time(hour=13, minute=45), German, "viertel vor zwei"), | ||
(time(hour=13, minute=15), German, "viertel nach eins"), | ||
(time(hour=13, minute=30), German, "halb zwei"), | ||
] | ||
|
||
|
||
@pytest.mark.parametrize("test_input, language, test_output", test_cases) | ||
def test_clocks(test_input, language, test_output): | ||
clock = Watch(language=language) | ||
assert test_output == clock(test_input) | ||
|
||
|
||
test_plural_cases = [ | ||
(time(hour=13, minute=1), German, "eine Minute nach eins"), | ||
(time(hour=6, minute=17), German, "siebzehn Minuten nach sechs"), | ||
] | ||
|
||
|
||
@pytest.mark.parametrize("test_input, language, test_output", test_plural_cases) | ||
def test_cases(test_input, language, test_output): | ||
clock = Watch(language=language) | ||
assert test_output == clock(test_input) |