def test_get_local_sources(mocker): """ At this moment, just return all sources. """ mock_session = mocker.MagicMock() get_local_sources(mock_session) mock_session.query.assert_called_once_with(securedrop_client.db.Source)
def update_sources(self): """ Display the updated list of sources with those found in local storage. """ sources = list(storage.get_local_sources(self.session)) self.gui.show_sources(sources) self.update_sync()
def update_sources(self): """ Display the updated list of sources with those found in local storage. """ sources = list(storage.get_local_sources(self.session)) if sources: sources.sort(key=lambda x: x.last_updated, reverse=True) self.gui.show_sources(sources) self.update_sync()