diff --git a/borgmatic/actions/browse/directory_list.py b/borgmatic/actions/browse/directory_list.py index cfa54b89..6e39c912 100644 --- a/borgmatic/actions/browse/directory_list.py +++ b/borgmatic/actions/browse/directory_list.py @@ -51,7 +51,9 @@ def make_directory_list_option(archive_path, relative_path_components): relative_path_components[0], ) + (('→', archive_path.link_target) if archive_path.link_target else ()) - return textual.widgets.option_list.Option(prompt=' '.join(pieces), id=relative_path_components[0]) + return textual.widgets.option_list.Option( + prompt=' '.join(pieces), id=relative_path_components[0] + ) def add_archive_paths( @@ -61,6 +63,10 @@ def add_archive_paths( archive_name, archive_paths, ): + ''' + Given a DirectoryList instance, a configuration dict, a repository dict, an archive name, and a + sequence of ArchivePath instances, add the archive paths to the directory list as options. + ''' highlighted_option = directory_list.highlighted_option original_options_count = len(directory_list.options) diff --git a/tests/integration/actions/browse/test_file_preview.py b/tests/integration/actions/browse/test_file_preview.py index 6ef8cf7c..72735ae8 100644 --- a/tests/integration/actions/browse/test_file_preview.py +++ b/tests/integration/actions/browse/test_file_preview.py @@ -7,8 +7,10 @@ import textual.widgets.option_list def test_file_preview_does_not_raise(): flexmock(module.borgmatic.actions.browse.loading).should_receive('add_inline_loading_indicator') flexmock(module.borgmatic.actions.browse.workers).should_receive('load_file_preview') - flexmock(module.borgmatic.actions.browse.repositories_list.Repositories_list).should_receive( + flexmock(module.borgmatic.actions.browse.file_preview.File_preview).should_receive( 'app' ).and_return(flexmock()) - module.Repositories_list(config=flexmock()) + module.File_preview( + config=flexmock(), repository=flexmock(), archive_name='archive', file_path='foo/bar.txt' + ) diff --git a/tests/unit/actions/browse/test_directories_list.py b/tests/unit/actions/browse/test_directories_list.py index 3ee21c38..76f8a1f6 100644 --- a/tests/unit/actions/browse/test_directories_list.py +++ b/tests/unit/actions/browse/test_directories_list.py @@ -50,7 +50,11 @@ def test_make_directory_list_option_with_contained_file_path_makes_directory_opt flexmock(module.textual.widgets.option_list).should_receive('Option').replace_with(flexmock) option = module.make_directory_list_option( - flexmock(path_type='d', file_path='foo/bar/baz.txt', link_target=''), ('bar', 'baz.txt',) + flexmock(path_type='d', file_path='foo/bar/baz.txt', link_target=''), + ( + 'bar', + 'baz.txt', + ), ) assert option.prompt == '📁 bar'