mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-16 14:33:39 +00:00
fix tests
This commit is contained in:
@@ -40,8 +40,17 @@ class TestUtils(unittest.TestCase):
|
|||||||
def test_removepath(self):
|
def test_removepath(self):
|
||||||
"""test removepath"""
|
"""test removepath"""
|
||||||
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):
|
with self.assertRaises(OSError):
|
||||||
removepath(os.path.expanduser('~'))
|
removepath(os.path.expanduser('~'))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user