you-get/tests/test_common.py
2013-07-11 16:48:28 +08:00

12 lines
356 B
Python

#!/usr/bin/env python
import unittest
from you_get import *
class TestCommon(unittest.TestCase):
def test_match1(self):
self.assertEqual(match1('http://youtu.be/1234567890A', r'youtu.be/([^/]+)'), '1234567890A')
self.assertEqual(match1('http://youtu.be/1234567890A', r'youtu.be/([^/]+)', r'youtu.(\w+)'), ['1234567890A', 'be'])