Test read_text returns file contents as string.
(self)
| 191 | |
| 192 | class TestAsyncPathFileIO: |
| 193 | async def test_read_text(self): |
| 194 | """Test read_text returns file contents as string.""" |
| 195 | with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp: |
| 196 | tmp.write("test content") |
| 197 | tmp.flush() |
| 198 | path = AsyncPath(tmp.name) |
| 199 | content = await path.read_text() |
| 200 | assert content == "test content" |
| 201 | os.unlink(tmp.name) |
| 202 | |
| 203 | async def test_read_text_with_encoding(self): |
| 204 | """Test read_text with specific encoding.""" |