you-get/tests/test_common.py

12 lines
363 B
Python
Raw Permalink Normal View History

2013-07-11 12:48:28 +04:00
#!/usr/bin/env python
import unittest
2014-07-21 05:17:30 +04:00
from you_get.common import *
2013-07-11 12:48:28 +04:00
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'])