(self)
| 388 | assert sorted(tar_data.getnames()) == sorted(expected_names) |
| 389 | |
| 390 | def test_tar_with_empty_directory(self): |
| 391 | base = tempfile.mkdtemp() |
| 392 | self.addCleanup(shutil.rmtree, base) |
| 393 | for d in ['foo', 'bar']: |
| 394 | os.makedirs(os.path.join(base, d)) |
| 395 | with tar(base) as archive: |
| 396 | tar_data = tarfile.open(fileobj=archive) |
| 397 | assert sorted(tar_data.getnames()) == ['bar', 'foo'] |
| 398 | |
| 399 | @pytest.mark.skipif( |
| 400 | IS_WINDOWS_PLATFORM or os.geteuid() == 0, |