Spaces:
Sleeping
Sleeping
Mel Seto
commited on
Commit
·
1533af6
1
Parent(s):
246f918
parametrize integration test
Browse files
tests/test_verifier_integration.py
CHANGED
|
@@ -4,25 +4,27 @@ from singletons import CC_DICT
|
|
| 4 |
|
| 5 |
|
| 6 |
@pytest.mark.integration
|
| 7 |
-
|
| 8 |
-
"
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
assert verify_idiom_exists(idiom) is False
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
idiom = "山珍海味"
|
| 22 |
-
assert verify_idiom_exists(idiom, wiktionary_client=wiktionary_client) is True
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
@pytest.mark.integration
|
| 7 |
+
@pytest.mark.parametrize(
|
| 8 |
+
"idiom, expected",
|
| 9 |
+
[
|
| 10 |
+
# ChiD idioms
|
| 11 |
+
("对症下药", True),
|
| 12 |
+
("画蛇添足", True),
|
| 13 |
+
("自相矛盾", True),
|
| 14 |
|
| 15 |
+
# CC-CEDICT idioms
|
| 16 |
+
("一成不变", True),
|
| 17 |
+
("铁面无私", True),
|
| 18 |
+
("德才兼备", True),
|
|
|
|
| 19 |
|
| 20 |
+
# Wiktionary-only
|
| 21 |
+
("临危不惧", True),
|
| 22 |
+
("心旷神怡", True),
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
# Nonexistent idiom
|
| 25 |
+
("完全不存在的成语", False),
|
| 26 |
+
]
|
| 27 |
+
)
|
| 28 |
+
def test_verify_idiom_integration(idiom, expected):
|
| 29 |
+
result = verify_idiom_exists(idiom)
|
| 30 |
+
assert result is expected
|