File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 44
55
66def test_decode_str ():
7- assert bdecode (b'6:WWWWWW' ) == "WWWWWW"
7+ assert bdecode (b'6:WWWWWW' ) == b "WWWWWW"
88
99
1010def test_decode_int ():
1111 assert bdecode (b'i233e' ) == 233
1212
1313
1414def test_decode_list ():
15- assert bdecode (b'l1:a1:bi3ee' ) == ['a' , 'b' , 3 ]
15+ assert bdecode (b'l1:a1:bi3ee' ) == [b 'a' , b 'b' , 3 ]
1616
1717
1818def test_decode_dict ():
1919 od = dict ()
20- od ['ka' ] = 'va'
21- od ['kb' ] = 2
20+ od [b 'ka' ] = b 'va'
21+ od [b 'kb' ] = 2
2222 assert bdecode (b'd2:ka2:va2:kbi2ee' ) == od
2323
2424
2525def test_encode_complex ():
2626 od = dict ()
27- od ['KeyA' ] = ['listitemA' , {'k' : 'v' }, 3 ]
28- od ['KeyB' ] = {'k' : 'v' }
29- od ['KeyC' ] = 3
30- od ['KeyD' ] = 'AString'
27+ od [b 'KeyA' ] = [b 'listitemA' , {b 'k' : b 'v' }, 3 ]
28+ od [b 'KeyB' ] = {b 'k' : b 'v' }
29+ od [b 'KeyC' ] = 3
30+ od [b 'KeyD' ] = b 'AString'
3131 expected_result = b'd4:KeyAl9:listitemAd1:k1:vei3ee4:KeyBd1:k1:ve4:KeyCi3e4:KeyD7:AStringe'
3232 assert bdecode (expected_result ) == od
You can’t perform that action at this time.
0 commit comments