andreafrancia / trash-cli

Command line interface to the freedesktop.org trashcan.
GNU General Public License v2.0
3.63k stars 177 forks source link

Fix unit test test_trash_empty_will_skip_unreadable_dir #220

Closed zpuskas closed 2 years ago

zpuskas commented 2 years ago

This patch fixes two issues with the current test:

Bug: GH-217

zpuskas commented 2 years ago

Test plan

>>> python -m unittest discover -v
...
test_trash_empty_will_skip_unreadable_dir (tests.test_trash_empty.TestTrashEmptyCmd) ... Would empty the following trash directories:
    - /tmp/tmpb55wh2os/data/Trash
    - /tmp/tmpb55wh2os/data/Trash/files/unreadable/.Trash-123
Proceed? (y/n) y
...
----------------------------------------------------------------------
Ran 280 tests in 67.236s

OK

>>> ll /tmp/tmpb55wh2os/data/Trash/files
total 0
drwxr-xr-x 3 <user> <user> 60 Dec  4 13:04 .
drwxr-xr-x 3 <user> <user> 60 Dec  4 13:04 ..
d-wx------ 2 <user> <user> 40 Dec  4 13:04 unreadable
andreafrancia commented 2 years ago

Good, thank you. cherry-picked