If the underlying zipfile is changed, the Path object should reflect that change.
(self, alpharep)
| 301 | |
| 302 | @pass_alpharep |
| 303 | def test_mutability(self, alpharep): |
| 304 | """ |
| 305 | If the underlying zipfile is changed, the Path object should |
| 306 | reflect that change. |
| 307 | """ |
| 308 | root = zipfile.Path(alpharep) |
| 309 | a, n, b, g, j = root.iterdir() |
| 310 | alpharep.writestr('foo.txt', 'foo') |
| 311 | alpharep.writestr('bar/baz.txt', 'baz') |
| 312 | assert any(child.name == 'foo.txt' for child in root.iterdir()) |
| 313 | assert (root / 'foo.txt').read_text(encoding="utf-8") == 'foo' |
| 314 | (baz,) = (root / 'bar').iterdir() |
| 315 | assert baz.read_text(encoding="utf-8") == 'baz' |
| 316 | |
| 317 | HUGE_ZIPFILE_NUM_ENTRIES = 2**13 |
| 318 |