mirror of
https://github.com/powerline/powerline.git
synced 2025-04-08 19:25:04 +02:00
Check that exception from watcher has errno attribute equal to ENOENT
This commit is contained in:
parent
9f7286e4e9
commit
fb022b7917
@ -6,6 +6,7 @@ import os
|
||||
|
||||
from time import sleep
|
||||
from functools import partial
|
||||
from errno import ENOENT
|
||||
|
||||
from powerline.lib.watcher import create_file_watcher, create_tree_watcher, INotifyError
|
||||
from powerline.lib.watcher.uv import UvNotFound
|
||||
@ -168,6 +169,10 @@ class TestFilesystemWatchers(TestCase):
|
||||
pass
|
||||
ne = os.path.join(INOTIFY_DIR, 'notexists')
|
||||
self.assertRaises(OSError, w, ne)
|
||||
try:
|
||||
w(ne)
|
||||
except OSError as e:
|
||||
self.assertEqual(e.errno, ENOENT)
|
||||
self.assertTrue(w(f1))
|
||||
self.assertFalse(w.is_watching(ne))
|
||||
self.assertTrue(w.is_watching(f1))
|
||||
|
Loading…
x
Reference in New Issue
Block a user