diff --git a/tests/test_wholefile.py b/tests/test_wholefile.py index 4fbcf8ca9..bd5a53139 100644 --- a/tests/test_wholefile.py +++ b/tests/test_wholefile.py @@ -41,6 +41,17 @@ class TestWholeFileCoder(unittest.TestCase): # This is throwing ValueError! coder.render_incremental_response(True) + def test_no_files_new_file_should_ask(self): + io = InputOutput(yes=False) # <- yes=FALSE + coder = WholeFileCoder(main_model=models.GPT35, io=io, fnames=[]) + coder.partial_response_content = ( + 'To print "Hello, World!" in most programming languages, you can use the following' + ' code:\n\nfoo.js\n```python\nprint("Hello, World!")\n```\n\nThis code will output' + ' "Hello, World!" to the console.' + ) + coder.update_files() + self.assertFalse(Path("foo.js").exists()) + def test_update_files(self): # Create a sample file in the temporary directory sample_file = "sample.txt"