diff options
Diffstat (limited to 'test/test_youtube_signature.py')
| -rw-r--r-- | test/test_youtube_signature.py | 18 | 
1 files changed, 15 insertions, 3 deletions
| diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py index d95533959..e8a67c4c0 100644 --- a/test/test_youtube_signature.py +++ b/test/test_youtube_signature.py @@ -45,6 +45,18 @@ _TESTS = [          u'2ACFC7A61CA478CD21425E5A57EBD73DDC78E22A.2094302436B2D377D14A3BBA23022D023B8BC25AA',          u'A52CB8B320D22032ABB3A41D773D2B6342034902.A22E87CDD37DBE75A5E52412DC874AC16A7CFCA2',      ), +    ( +        u'http://s.ytimg.com/yts/swfbin/player-vfl5vIhK2/watch_as3.swf', +        u'swf', +        86, +        u'O1I3456789abcde0ghijklmnopqrstuvwxyzABCDEFGHfJKLMN2PQRSTUVWXY\\!"#$%&\'()*+,-./:;<=>?' +    ), +    ( +        u'http://s.ytimg.com/yts/swfbin/player-vflmDyk47/watch_as3.swf', +        u'swf', +        u'F375F75BF2AFDAAF2666E43868D46816F83F13E81C46.3725A8218E446A0DECD33F79DC282994D6AA92C92C9', +        u'9C29AA6D499282CD97F33DCED0A644E8128A5273.64C18E31F38361864D86834E6662FAADFA2FB57F' +    ),  ] @@ -57,12 +69,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): | 
