mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-02 11:16:41 +00:00
fix behavior of fake fileops test-helper
This commit is contained in:
parent
2fd2a9b2c7
commit
fcfcbaa6a2
@ -411,6 +411,9 @@ class FileOperationsHelper(object):
|
|||||||
|
|
||||||
def write(self, path_u, contents):
|
def write(self, path_u, contents):
|
||||||
fname = path_u
|
fname = path_u
|
||||||
|
if not os.path.exists(fname):
|
||||||
|
self._maybe_notify(fname, self._inotify.IN_CREATE)
|
||||||
|
|
||||||
d = self._uploader.set_hook('inotify')
|
d = self._uploader.set_hook('inotify')
|
||||||
with open(fname, "wb") as f:
|
with open(fname, "wb") as f:
|
||||||
f.write(contents)
|
f.write(contents)
|
||||||
@ -435,7 +438,7 @@ class FileOperationsHelper(object):
|
|||||||
|
|
||||||
def _maybe_notify(self, fname, mask):
|
def _maybe_notify(self, fname, mask):
|
||||||
if self._fake_inotify:
|
if self._fake_inotify:
|
||||||
self._uploader._notifier.event(to_filepath(fname), self._inotify.IN_DELETE)
|
self._uploader._notifier.event(to_filepath(fname), mask)
|
||||||
|
|
||||||
|
|
||||||
class CheckerMixin(object):
|
class CheckerMixin(object):
|
||||||
|
Loading…
Reference in New Issue
Block a user