Mel Seto commited on
Commit
1533af6
·
1 Parent(s): 246f918

parametrize integration test

Browse files
Files changed (1) hide show
  1. tests/test_verifier_integration.py +21 -19
tests/test_verifier_integration.py CHANGED
@@ -4,25 +4,27 @@ from singletons import CC_DICT
4
 
5
 
6
  @pytest.mark.integration
7
- def test_real_idiom_in_cc_cedict():
8
- """Verify a known idiom exists in CC-CEDICT."""
9
- idiom = "山珍海味"
10
- assert verify_idiom_exists(idiom) is True
 
 
 
11
 
12
- @pytest.mark.integration
13
- def test_fake_idiom_not_in_cc_cedict():
14
- """Verify a non-existent idiom returns False."""
15
- idiom = "不存在的成语"
16
- assert verify_idiom_exists(idiom) is False
17
 
18
- @pytest.mark.integration
19
- def test_real_idiom_wiktionary(wiktionary_client):
20
- """Verify that a known idiom exists on Wiktionary."""
21
- idiom = "山珍海味"
22
- assert verify_idiom_exists(idiom, wiktionary_client=wiktionary_client) is True
23
 
24
- @pytest.mark.integration
25
- def test_fake_idiom_wiktionary(wiktionary_client):
26
- """Verify that a made-up idiom does not exist on Wiktionary."""
27
- idiom = "不存在的成语"
28
- assert verify_idiom_exists(idiom, wiktionary_client=wiktionary_client) is False
 
 
 
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