1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 16:14:45 +00:00

fix tests

This commit is contained in:
deadc0de6
2024-08-21 21:33:52 +02:00
committed by deadc0de
parent 88e9c6edf1
commit fe40a1e836

View File

@@ -40,8 +40,17 @@ class TestUtils(unittest.TestCase):
def test_removepath(self):
"""test removepath"""
removepath('')
with self.assertRaises(OSError):
removepath('/abc')
tmpdir = get_tempdir()
self.addCleanup(clean, tmpdir)
afile, _ = create_random_file(tmpdir, content='blah')
try:
removepath(afile)
except OSError:
self.fail('must not raise OSError')
if os.path.exists(afile):
self.fail(f'{afile} not deleted')
with self.assertRaises(OSError):
removepath(os.path.expanduser('~'))