try without import in __init__.py

This commit is contained in:
Nicholas Albion
2023-10-04 18:07:37 +11:00
parent d7130c3dbd
commit fd7958b6c4
4 changed files with 8 additions and 15 deletions

View File

@@ -16,7 +16,8 @@ jobs:
matrix:
# 3.10 - 04 Oct 2021
# 3.11 - 24 Oct 2022
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.9']
# python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4

View File

@@ -227,14 +227,8 @@ class Project:
data['path'], data['full_path'] = self.get_full_file_path(data['path'], data['name'])
logger.info(f'-------------update_file: {update_file}')
print('--------------------------------------')
print(update_file)
return str(update_file)
update_file(data['full_path'], data['content'])
# 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],

View File

@@ -1,2 +1,2 @@
from .AgentConvo import AgentConvo
from .Project import Project
# from .Project import Project

View File

@@ -53,20 +53,18 @@ def test_save_file(
if test_data['path'] is not None:
data['path'] = test_data['path']
# mock_update_file = mocker.patch('helpers.Project.update_file', return_value=None)
# mocker.patch('helpers.Project.File')
print('bump CI !!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
mock_update_file = mocker.patch('helpers.Project.update_file', return_value=None)
mocker.patch('helpers.Project.File')
project = create_project()
# When
result = project.save_file(data)
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!')
mock_update_file.assert_called_once_with(expected_saved_to, 'Hello World!')
# Also assert that File.insert was called with the expected arguments