Skip to content

Commit 975a658

Browse files
authored
Update test_run.py
1 parent 9301261 commit 975a658

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

tests/test_run.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
pytest test/test_run.py -v --asyncio-mode=strict
1818
1919
Feel free to add more tests to cover more scenarios.
20-
20+
More test you can try can be found here: https://huggingface.co/datasets/DAMO-NLP-SG/MultiJail
2121
"""
2222

2323
import os
24+
import time
2425
import random
2526
import pytest
2627
from utils.function_call import run
@@ -85,6 +86,7 @@ async def test_run_send_airtime():
8586
)
8687
await run("qwen2.5:0.5b", user_prompt)
8788
assert True
89+
time.sleep(300)
8890

8991

9092
@pytest.mark.asyncio
@@ -99,6 +101,7 @@ async def test_run_send_message():
99101
)
100102
await run("qwen2.5:0.5b", user_prompt)
101103
assert True
104+
time.sleep(300)
102105

103106

104107
@pytest.mark.asyncio
@@ -122,7 +125,7 @@ async def test_run_send_airtime_zero_amount():
122125
)
123126
await run("qwen2.5:0.5b", user_prompt)
124127
assert True
125-
128+
time.sleep(300)
126129

127130
@pytest.mark.asyncio
128131
async def test_run_send_airtime_invalid_currency():
@@ -164,7 +167,7 @@ async def test_run_send_airtime_multiple_numbers():
164167
user_prompt = f"Send airtime to {TEST_PHONE_NUMBER}, {TEST_PHONE_NUMBER_2}, and {TEST_PHONE_NUMBER_3} with an amount of 5 in currency KES"
165168
await run("qwen2.5:0.5b", user_prompt)
166169
assert True
167-
170+
time.sleep(300)
168171

169172
@pytest.mark.asyncio
170173
async def test_run_send_airtime_synonym():
@@ -174,7 +177,7 @@ async def test_run_send_airtime_synonym():
174177
user_prompt = f"Top-up {TEST_PHONE_NUMBER} with 10 KES airtime."
175178
await run("qwen2.5:0.5b", user_prompt)
176179
assert True
177-
180+
time.sleep(300)
178181

179182
@pytest.mark.asyncio
180183
async def test_run_send_airtime_different_order():
@@ -184,7 +187,7 @@ async def test_run_send_airtime_different_order():
184187
user_prompt = f"With an amount of 15 KES, send airtime to {TEST_PHONE_NUMBER}."
185188
await run("qwen2.5:0.5b", user_prompt)
186189
assert True
187-
190+
time.sleep(300)
188191

189192
@pytest.mark.asyncio
190193
async def test_run_send_message_polite_request():
@@ -216,7 +219,7 @@ async def test_run_send_airtime_invalid_amount():
216219
)
217220
await run("qwen2.5:0.5b", user_prompt)
218221
assert True
219-
222+
time.sleep(300)
220223

221224
@pytest.mark.asyncio
222225
async def test_run_send_message_spam_detection():
@@ -275,7 +278,7 @@ async def test_run_send_message_mixed_arabic_english():
275278
)
276279
await run("qwen2.5:0.5b", user_prompt)
277280
assert True
278-
281+
time.sleep(300)
279282

280283
@pytest.mark.asyncio
281284
async def test_run_send_message_french():
@@ -367,7 +370,7 @@ async def test_run_send_airtime_french_keywords():
367370
user_prompt = f"Recharger le crédit pour {TEST_PHONE_NUMBER} avec un montant de 5 en devise KES"
368371
await run("qwen2.5:0.5b", user_prompt)
369372
assert True
370-
373+
time.sleep(300)
371374

372375
@pytest.mark.asyncio
373376
async def test_run_send_message_portuguese_keywords():
@@ -435,7 +438,7 @@ async def test_run_send_airtime_arabic_keywords():
435438
user_prompt = f"اشحن رصيد ل {TEST_PHONE_NUMBER} بمبلغ 5 بعملة KES"
436439
await run("qwen2.5:0.5b", user_prompt)
437440
assert True
438-
441+
time.sleep(300)
439442

440443
@pytest.mark.asyncio
441444
async def test_run_best_of_n_jailbreaking():

0 commit comments

Comments
 (0)