"""The "send larger work to AITURK" instruction reaches only Codex Desktop, and only when a send command exists.""" import unittest import is_hatti as h class Hat(unittest.TestCase): def test_only_the_desktop_app_is_recognised(self): self.assertTrue(h.masaustu_mu("Codex Desktop")) for other in ("codex-tui", "codex_exec", "codex_cli_rs", "", None, "Codex Desktop Helper"): self.assertFalse(h.masaustu_mu(other), other) def test_no_instruction_without_the_switch_or_without_a_send_command(self): self.assertIsNone(h.talimat(None)) self.assertIsNone(h.talimat({"enabled": False, "komut": "aiturk gonder"})) self.assertIsNone(h.talimat({"enabled": True})) self.assertIsNone(h.talimat({"enabled": True, "komut": " "})) text = h.talimat({"enabled": True, "komut": "aiturk gonder --dosya is.md"}) self.assertIn("aiturk gonder --dosya is.md", text) self.assertIn("sen yap", text) self.assertEqual(h.talimat({"enabled": True, "komut": "x", "talimat": "ozel {komut}"}), "ozel x") def test_instruction_is_put_first_once_and_never_repeated(self): req = {"input": [{"type": "message", "role": "user", "content": "selam"}]} text = h.talimat({"enabled": True, "komut": "aiturk gonder"}) self.assertTrue(h.ekle(req, text)) self.assertEqual((req["input"][0]["role"], len(req["input"])), ("developer", 2)) self.assertFalse(h.ekle(req, text)) self.assertEqual(len(req["input"]), 2) self.assertFalse(h.ekle({"input": "duz metin"}, text)) self.assertFalse(h.ekle(req, None)) if __name__ == "__main__": unittest.main()