diff --git a/pilot/helpers/Project.py b/pilot/helpers/Project.py index e9ac13d..013e32d 100644 --- a/pilot/helpers/Project.py +++ b/pilot/helpers/Project.py @@ -230,6 +230,7 @@ class Project: logger.info(f'-------------update_file: {update_file}') print('--------------------------------------') print(update_file) + return str(update_file) # update_file(data['full_path'], data['content']) diff --git a/pilot/helpers/test_Project.py b/pilot/helpers/test_Project.py index b4f9325..121cdc3 100644 --- a/pilot/helpers/test_Project.py +++ b/pilot/helpers/test_Project.py @@ -60,13 +60,15 @@ def test_save_file( project = create_project() # When - project.save_file(data) + result = project.save_file(data) + + assert result == '' # Then assert that update_file with the correct path expected_saved_to = test_data['saved_to'] # mock_update_file.assert_called_once_with(expected_saved_to, 'Hello World!') - + # Also assert that File.insert was called with the expected arguments # expected_file_data = {'app': project.app, 'path': test_data['path'], 'name': test_data['name'], # 'full_path': expected_saved_to}