(self)
| 506 | self.assertEqual(len(coder.abs_fnames), 1) |
| 507 | |
| 508 | def test_choose_fence(self): |
| 509 | # Create a few temporary files |
| 510 | _, file1 = tempfile.mkstemp() |
| 511 | |
| 512 | with open(file1, "wb") as f: |
| 513 | f.write(b"this contains\n```\nbackticks") |
| 514 | |
| 515 | files = [file1] |
| 516 | |
| 517 | # Initialize the Coder object with the mocked IO and mocked repo |
| 518 | coder = Coder.create(self.GPT35, None, io=InputOutput(), fnames=files) |
| 519 | |
| 520 | def mock_send(*args, **kwargs): |
| 521 | coder.partial_response_content = "ok" |
| 522 | coder.partial_response_function_call = dict() |
| 523 | return [] |
| 524 | |
| 525 | coder.send = mock_send |
| 526 | |
| 527 | # Call the run method with a message |
| 528 | coder.run(with_message="hi") |
| 529 | |
| 530 | self.assertNotEqual(coder.fence[0], "```") |
| 531 | |
| 532 | def test_run_with_file_utf_unicode_error(self): |
| 533 | "make sure that we honor InputOutput(encoding) and don't just assume utf-8" |
nothing calls this directly
no test coverage detected