From 1143535d762fc4260aacc108f2c41079867f9f00 Mon Sep 17 00:00:00 2001 From: Yen Chi Hsuan Date: Sun, 26 Jun 2016 15:16:49 +0800 Subject: [utils] Add urshift() Used in IqiyiIE and LeIE --- test/test_utils.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/test_utils.py b/test/test_utils.py index 7f9385deb..ed61e4c27 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -66,6 +66,7 @@ from youtube_dl.utils import ( lowercase_escape, url_basename, urlencode_postdata, + urshift, update_url_query, version_tuple, xpath_with_ns, @@ -980,5 +981,9 @@ The first line self.assertRaises(ValueError, encode_base_n, 0, 70) self.assertRaises(ValueError, encode_base_n, 0, 60, custom_table) + def test_urshift(self): + self.assertEqual(urshift(3, 1), 1) + self.assertEqual(urshift(-3, 1), 2147483646) + if __name__ == '__main__': unittest.main() -- cgit v1.2.3