diff options
Diffstat (limited to 'deluge/tests/test_ui_common.py')
-rw-r--r-- | deluge/tests/test_ui_common.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/deluge/tests/test_ui_common.py b/deluge/tests/test_ui_common.py index ee97259..fc56ebc 100644 --- a/deluge/tests/test_ui_common.py +++ b/deluge/tests/test_ui_common.py @@ -157,3 +157,19 @@ class TestUICommon: ] assert len(ti.files) == len(result_files) + + def test_directory_with_single_file(self): + filename = common.get_test_data_file('dir_with_single_file.torrent') + + ti = TorrentInfo(filename) + expected_file_tree = {'dir_with_single_file': {'single_file.txt': (0, 9, True)}} + assert ti.files_tree == expected_file_tree + + result_files = [ + { + 'path': 'dir_with_single_file/single_file.txt', + 'size': 9, + 'download': True, + } + ] + assert ti.files == result_files |