1
0
mirror of https://github.com/arsenetar/send2trash.git synced 2024-12-03 19:59:02 +00:00

Minor fixes to tests

This commit is contained in:
Andrew Senetar 2021-03-17 21:51:51 -05:00
parent 356509120b
commit 10c7693d11
Signed by: arsenetar
GPG Key ID: C63300DCE48AB2F1
2 changed files with 8 additions and 6 deletions

View File

@ -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]

View File

@ -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