user commom.awrite in Editr.create_file

This commit is contained in:
黄伟韬 2024-09-29 14:29:10 +08:00
parent 58907d0dbb
commit b7ef5d6718
2 changed files with 6 additions and 7 deletions

View file

@ -270,9 +270,10 @@ def test_create_file_unexist_path():
editor.create_file("/unexist/path/a.txt")
def test_create_file(temp_file_path):
@pytest.mark.asyncio
async def test_create_file(temp_file_path):
editor = Editor()
result = editor.create_file(str(temp_file_path))
result = await editor.create_file(str(temp_file_path))
expected = f"[File {temp_file_path} created.]"
assert result.split("\n") == expected.split("\n")