If the zipfile is open for write, it should be possible to write bytes or text to it.
(self)
| 200 | assert __file__ == wc.filename |
| 201 | |
| 202 | def test_open_write(self): |
| 203 | """ |
| 204 | If the zipfile is open for write, it should be possible to |
| 205 | write bytes or text to it. |
| 206 | """ |
| 207 | zf = zipfile.Path(zipfile.ZipFile(io.BytesIO(), mode='w')) |
| 208 | with zf.joinpath('file.bin').open('wb') as strm: |
| 209 | strm.write(b'binary contents') |
| 210 | with zf.joinpath('file.txt').open('w', encoding="utf-8") as strm: |
| 211 | strm.write('text file') |
| 212 | |
| 213 | @pass_alpharep |
| 214 | def test_open_extant_directory(self, alpharep): |