feat: upgrade客服多店铺分流、批量报价与稳定性防护
This commit is contained in:
20
tests/test_transfer_greeting_context.py
Normal file
20
tests/test_transfer_greeting_context.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import unittest
|
||||
|
||||
from core.websocket_client import QingjianAPIClient
|
||||
|
||||
|
||||
class TransferGreetingContextTest(unittest.TestCase):
|
||||
def test_transfer_greeting_is_non_empty(self):
|
||||
c = QingjianAPIClient(enable_agent=False)
|
||||
text = c._pick_transfer_greeting()
|
||||
self.assertTrue(isinstance(text, str) and len(text) > 0)
|
||||
|
||||
def test_transfer_greeting_contains_presence_phrase(self):
|
||||
c = QingjianAPIClient(enable_agent=False)
|
||||
for _ in range(10):
|
||||
text = c._pick_transfer_greeting()
|
||||
self.assertTrue(("在" in text) or ("我在" in text))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(verbosity=2)
|
||||
Reference in New Issue
Block a user