core: Fix review comments for PR#1111
This commit is contained in:
parent
e5f59495fc
commit
2cc91c0a7f
@ -68,7 +68,9 @@ class LibraryController(object):
|
||||
|
||||
.. versionadded:: 0.18
|
||||
"""
|
||||
return self._roots() if uri is None else self._browse(uri)
|
||||
if uri is None:
|
||||
return self._roots()
|
||||
return self._browse(uri)
|
||||
|
||||
def _roots(self):
|
||||
directories = set()
|
||||
@ -87,7 +89,7 @@ class LibraryController(object):
|
||||
backend = self.backends.with_library_browse.get(scheme)
|
||||
try:
|
||||
if backend:
|
||||
return backend.library.browse(uri).get() # TODO: sort?
|
||||
return backend.library.browse(uri).get()
|
||||
except Exception:
|
||||
logger.exception('%s backend caused an exception.',
|
||||
backend.actor_ref.actor_class.__name__)
|
||||
|
||||
@ -443,7 +443,7 @@ class BackendFailuresCoreLibraryTest(unittest.TestCase):
|
||||
self.assertEqual([], self.core.library.browse(None))
|
||||
logger.exception.assert_called_with(mock.ANY, 'DummyBackend')
|
||||
|
||||
def test_browse_backend_browse_uri_exception_gets_through(self, logger):
|
||||
def test_browse_backend_browse_uri_exception_gets_ignored(self, logger):
|
||||
self.library.browse.return_value.get.side_effect = Exception
|
||||
self.assertEqual([], self.core.library.browse('dummy:directory'))
|
||||
logger.exception.assert_called_with(mock.ANY, 'DummyBackend')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user