(server)
| 169 | |
| 170 | |
| 171 | def test_download(server): |
| 172 | url = str(server.url) |
| 173 | runner = CliRunner() |
| 174 | with runner.isolated_filesystem(): |
| 175 | runner.invoke(httpx.main, [url, "--download", "index.txt"]) |
| 176 | assert os.path.exists("index.txt") |
| 177 | with open("index.txt", "r") as input_file: |
| 178 | assert input_file.read() == "Hello, world!" |
| 179 | |
| 180 | |
| 181 | def test_errors(): |