Browse Source

Minor fixes to tests

feature/#51
Andrew Senetar 2 months ago
parent
commit
10c7693d11
Signed by: arsenetar GPG Key ID: C63300DCE48AB2F1
  1. 4
      tests/test_plat_other.py
  2. 10
      tests/test_plat_win.py

4
tests/test_plat_other.py

@ -32,7 +32,7 @@ def testfile():
dir=op.expanduser("~"), prefix="send2trash_test", delete=False
)
file.close()
assert op.exists(file) is True
assert op.exists(file.name) is True
yield file
# Cleanup trash files on supported platforms
if sys.platform != "win32":
@ -58,7 +58,7 @@ def testfiles():
)
)
[file.close() for file in files]
assert all([op.exists(file) for file in files]) is True
assert all([op.exists(file.name) for file in files]) is True
yield files
filenames = [op.basename(file.name) for file in files]
[os.remove(op.join(HOMETRASH, "files", filename)) for filename in filenames]

10
tests/test_plat_win.py

@ -70,12 +70,14 @@ def _file_not_found(dir, fcn):
def _multi_byte_unicode(dir, fcn):
file = op.join(dir, "😇.txt")
_create_tree(file)
fcn(file)
assert op.exists(file) is False
single_file = op.join(dir, "😇.txt")
_create_tree(single_file)
assert op.exists(single_file) is True
fcn(single_file)
assert op.exists(single_file) is False
files = [op.join(dir, "😇{}.txt".format(index)) for index in range(10)]
[_create_tree(file) for file in files]
assert all([op.exists(file) for file in files]) is True
fcn(files)
assert any([op.exists(file) for file in files]) is False

Loading…
Cancel
Save