previous commit worked, feeling confident

This commit is contained in:
Nicholas Albion
2023-10-04 18:09:28 +11:00
parent fd7958b6c4
commit 2e87627db8
2 changed files with 13 additions and 14 deletions

View File

@@ -37,14 +37,14 @@ def create_project():
# 'None name', 'empty name',
# 'None path absolute file', 'home path', 'home path same name', 'absolute path with name'
])
# @patch('helpers.Project.update_file')
# @patch('helpers.Project.File')
@patch('helpers.Project.update_file')
@patch('helpers.Project.File')
def test_save_file(
# mock_file_insert,
# mock_update_file,
mock_file_insert,
mock_update_file,
test_data,
# monkeypatch
mocker
# mocker
):
# Given
data = {'content': 'Hello World!'}
@@ -53,15 +53,14 @@ 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')
# mock_update_file = mocker.patch('helpers.Project.update_file', return_value=None)
# mocker.patch('helpers.Project.File')
project = create_project()
# When
project.save_file(data)
# 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!')