[utils,compat] Move struct_pack and struct_unpack to compat.py
This commit is contained in:
parent
4350b74545
commit
dab0daeeb0
7 changed files with 38 additions and 28 deletions
|
@ -20,6 +20,7 @@ from youtube_dl.compat import (
|
|||
compat_urllib_parse_unquote,
|
||||
compat_urllib_parse_unquote_plus,
|
||||
compat_urllib_parse_urlencode,
|
||||
struct_unpack,
|
||||
)
|
||||
|
||||
|
||||
|
@ -102,5 +103,9 @@ class TestCompat(unittest.TestCase):
|
|||
self.assertTrue(isinstance(doc.find('chinese').text, compat_str))
|
||||
self.assertTrue(isinstance(doc.find('foo/bar').text, compat_str))
|
||||
|
||||
def test_struct_unpack(self):
|
||||
self.assertEqual(struct_unpack('!B', b'\x00'), (0,))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue