mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 16:14:45 +00:00
fix tests
This commit is contained in:
@@ -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('~'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user