aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-04-23 18:28:49 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2016-05-10 14:51:38 +0800
commitdab0daeeb0929b9b560d2b9a5f39c1e2e6dfa449 (patch)
treeed4c6036aa4e509a9d46e9c184c819702fb4f5c5 /test
parent4350b74545ea3d3ce072444655613bc6974d5516 (diff)
[utils,compat] Move struct_pack and struct_unpack to compat.py
Diffstat (limited to 'test')
-rw-r--r--test/test_compat.py5
-rw-r--r--test/test_utils.py4
2 files changed, 5 insertions, 4 deletions
diff --git a/test/test_compat.py b/test/test_compat.py
index 9adf75763..dd62a5d6b 100644
--- a/test/test_compat.py
+++ b/test/test_compat.py
@@ -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()
diff --git a/test/test_utils.py b/test/test_utils.py
index 00ada95ec..5702ffa97 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -55,7 +55,6 @@ from youtube_dl.utils import (
smuggle_url,
str_to_int,
strip_jsonp,
- struct_unpack,
timeconvert,
unescapeHTML,
unified_strdate,
@@ -457,9 +456,6 @@ class TestUtil(unittest.TestCase):
testPL(5, 2, (2, 99), [2, 3, 4])
testPL(5, 2, (20, 99), [])
- def test_struct_unpack(self):
- self.assertEqual(struct_unpack('!B', b'\x00'), (0,))
-
def test_read_batch_urls(self):
f = io.StringIO('''\xef\xbb\xbf foo
bar\r