From 67f88a6924320af99d7c7d817354076ff4455dd0 Mon Sep 17 00:00:00 2001 From: Nicholas Albion Date: Wed, 4 Oct 2023 17:46:19 +1100 Subject: [PATCH] where is update_file --- pilot/helpers/Project.py | 20 +++++++++++++------- pilot/helpers/agents/test_Developer.py | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pilot/helpers/Project.py b/pilot/helpers/Project.py index 4c610fb..b0d7be0 100644 --- a/pilot/helpers/Project.py +++ b/pilot/helpers/Project.py @@ -226,14 +226,20 @@ class Project: # TODO END data['path'], data['full_path'] = self.get_full_file_path(data['path'], data['name']) - update_file(data['full_path'], data['content']) - (File.insert(app=self.app, path=data['path'], name=data['name'], full_path=data['full_path']) - .on_conflict( - conflict_target=[File.app, File.name, File.path], - preserve=[], - update={ 'name': data['name'], 'path': data['path'], 'full_path': data['full_path'] }) - .execute()) + logger.info(f'-------------update_file: {update_file}') + print('--------------------------------------') + print(update_file) + + + # update_file(data['full_path'], data['content']) + # + # (File.insert(app=self.app, path=data['path'], name=data['name'], full_path=data['full_path']) + # .on_conflict( + # conflict_target=[File.app, File.name, File.path], + # preserve=[], + # update={ 'name': data['name'], 'path': data['path'], 'full_path': data['full_path'] }) + # .execute()) def get_full_file_path(self, file_path: str, file_name: str) -> Tuple[str, str]: diff --git a/pilot/helpers/agents/test_Developer.py b/pilot/helpers/agents/test_Developer.py index 9b40297..0a8eeba 100644 --- a/pilot/helpers/agents/test_Developer.py +++ b/pilot/helpers/agents/test_Developer.py @@ -129,7 +129,7 @@ class TestDeveloper: @patch('helpers.cli.execute_command', return_value=('stdout:\n```\n\n```', 'DONE')) @patch('helpers.AgentConvo.get_saved_development_step') - @patch('helpers.AgentConvo.save_development_step', new_callable=MagicMock) + @patch('helpers.AgentConvo.save_development_step') @patch('utils.llm_connection.requests.post') @patch('utils.questionary.get_saved_user_input') def test_test_code_changes_invalid_json(self, mock_get_saved_user_input,