where is update_file

This commit is contained in:
Nicholas Albion
2023-10-04 17:46:19 +11:00
parent bb6a2b6a88
commit 67f88a6924
2 changed files with 14 additions and 8 deletions

View File

@@ -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]:

View File

@@ -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,