summaryrefslogtreecommitdiffstats
path: root/deluge/tests/test_ui_common.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-24 17:38:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-24 17:38:25 +0000
commitd269eb36c8f4d05fb0f8e9b8a00998dd41f0c829 (patch)
tree4268cb5c733a3b88e7c5b765a30f5b9fd81c804e /deluge/tests/test_ui_common.py
parentAdding upstream version 2.1.1. (diff)
downloaddeluge-d269eb36c8f4d05fb0f8e9b8a00998dd41f0c829.tar.xz
deluge-d269eb36c8f4d05fb0f8e9b8a00998dd41f0c829.zip
Adding upstream version 2.1.2~dev0+20230529.upstream/2.1.2_dev0+20230529
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/tests/test_ui_common.py')
-rw-r--r--deluge/tests/test_ui_common.py16
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