| 383 | copied.remove() |
| 384 | |
| 385 | def test_copy_dir(self, path1): |
| 386 | otherdir = path1.join(class="st">"otherdir") |
| 387 | copied = path1.join(class="st">"newdir") |
| 388 | try: |
| 389 | otherdir.copy(copied) |
| 390 | assert copied.check(dir=1) |
| 391 | assert copied.join(class="st">"__init__.py").check(file=1) |
| 392 | s1 = otherdir.join(class="st">"__init__.py").read_text(encoding=class="st">"utf-8") |
| 393 | s2 = copied.join(class="st">"__init__.py").read_text(encoding=class="st">"utf-8") |
| 394 | assert s1 == s2 |
| 395 | finally: |
| 396 | if copied.check(dir=1): |
| 397 | copied.remove(rec=1) |
| 398 | |
| 399 | def test_remove_file(self, path1): |
| 400 | d = path1.ensure(class="st">"todeleted") |