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)
