test_magic_folder: turn off debugging when done

This commit is contained in:
Brian Warner 2016-10-24 09:23:16 -07:00
parent d6cbe44786
commit ae5637dc9c
2 changed files with 10 additions and 5 deletions

View File

@ -86,10 +86,10 @@ class MagicFolder(service.MultiService):
self.set_public_status)
self._public_status = (False, ['Magic folder has not yet started'])
def enable_debug_log(self):
def enable_debug_log(self, enabled=True):
print "enable debug log"
self.uploader.enable_debug_log()
self.downloader.enable_debug_log()
self.uploader.enable_debug_log(enabled)
self.downloader.enable_debug_log(enabled)
def get_public_status(self):
"""
@ -172,9 +172,9 @@ class QueueMixin(HookMixin):
# far)
self._processing = defer.succeed(None)
def enable_debug_log(self):
def enable_debug_log(self, enabled=True):
print "queue mixin enable debug logging"
self._debug_log = True
self._debug_log = enabled
def get_status(self):
"""

View File

@ -1032,6 +1032,11 @@ class SingleMagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, Reall
def tearDown(self):
d = super(SingleMagicFolderTestMixin, self).tearDown()
def _disable_debugging(res):
if self.magicfolder:
self.magicfolder.enable_debug_log(False)
return res
d.addBoth(_disable_debugging)
d.addCallback(self.cleanup)
return d