(self)
| 1058 | self.assertTrue(len(exc.valid_formats) > 0) |
| 1059 | |
| 1060 | def test_system_prompt_prefix(self): |
| 1061 | # Test that system_prompt_prefix is properly set and used |
| 1062 | io = InputOutput(yes=True) |
| 1063 | test_prefix = "Test prefix. " |
| 1064 | |
| 1065 | # Create a model with system_prompt_prefix |
| 1066 | model = Model("gpt-3.5-turbo") |
| 1067 | model.system_prompt_prefix = test_prefix |
| 1068 | |
| 1069 | coder = Coder.create(model, None, io=io) |
| 1070 | |
| 1071 | # Get the formatted messages |
| 1072 | chunks = coder.format_messages() |
| 1073 | messages = chunks.all_messages() |
| 1074 | |
| 1075 | # Check if the system message contains our prefix |
| 1076 | system_message = next(msg for msg in messages if msg["role"] == "system") |
| 1077 | self.assertTrue(system_message["content"].startswith(test_prefix)) |
| 1078 | |
| 1079 | def test_coder_create_with_new_file_oserror(self): |
| 1080 | with GitTemporaryDirectory(): |
nothing calls this directly
no test coverage detected