fix: support v2 and hybrid qBittorrent identities

This commit is contained in:
2026-07-23 11:48:08 +00:00
parent 69709c778b
commit 6ca94a546e
10 changed files with 240 additions and 74 deletions
+9 -5
View File
@@ -15,9 +15,11 @@ class ResourceTests(unittest.TestCase):
def test_pure_v2_identity_and_single_file_tree_normalization(self):
info = {
b"file tree": {
b"": {
b"length": 3,
b"pieces root": b"x" * 32,
b"v2.bin": {
b"": {
b"length": 3,
b"pieces root": b"x" * 32,
},
},
},
b"meta version": 2,
@@ -57,8 +59,10 @@ class ResourceTests(unittest.TestCase):
def test_hybrid_identity_and_selection_normalization(self):
info = {
b"file tree": {
b"a.txt": {b"": {b"length": 3}},
b"b.bin": {b"": {b"attr": b"p", b"length": 5}},
b"resource": {
b"a.txt": {b"": {b"length": 3}},
b"b.bin": {b"": {b"attr": b"p", b"length": 5}},
},
},
b"files": [
{b"length": 3, b"path": [b"a.txt"]},