aboutsummaryrefslogtreecommitdiff
path: root/test/test_youtube_signature.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-07-18 10:24:28 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-07-18 10:24:28 +0200
commit5425626790a46f9b5bdecf4e33bb254c4c2423ea (patch)
treefffe33aebe1cd1655ed32230e239cd74b4f3c6f4 /test/test_youtube_signature.py
parent5dc3552d85ac2b3723d0548bbe44996d50891cf2 (diff)
[youtube] Move swfinterp into its own file
Diffstat (limited to 'test/test_youtube_signature.py')
-rw-r--r--test/test_youtube_signature.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py
index d95533959..e443e0be8 100644
--- a/test/test_youtube_signature.py
+++ b/test/test_youtube_signature.py
@@ -45,6 +45,12 @@ _TESTS = [
u'2ACFC7A61CA478CD21425E5A57EBD73DDC78E22A.2094302436B2D377D14A3BBA23022D023B8BC25AA',
u'A52CB8B320D22032ABB3A41D773D2B6342034902.A22E87CDD37DBE75A5E52412DC874AC16A7CFCA2',
),
+ (
+ u'http://s.ytimg.com/yts/swfbin/player-vfl5vIhK2/watch_as3.swf',
+ u'swf',
+ 86,
+ u'23456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!?#$%&\'()*+,-./:;<=>"'
+ ),
]
@@ -57,12 +63,12 @@ class TestSignature(unittest.TestCase):
def make_tfunc(url, stype, sig_input, expected_sig):
- basename = url.rpartition('/')[2]
- m = re.match(r'.*-([a-zA-Z0-9_-]+)\.[a-z]+$', basename)
- assert m, '%r should follow URL format' % basename
+ m = re.match(r'.*-([a-zA-Z0-9_-]+)(?:/watch_as3)?\.[a-z]+$', url)
+ assert m, '%r should follow URL format' % url
test_id = m.group(1)
def test_func(self):
+ basename = 'player-%s.%s' % (test_id, stype)
fn = os.path.join(self.TESTDATA_DIR, basename)
if not os.path.exists(fn):