logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

test_postprocessors.py (494B)


  1. #!/usr/bin/env python
  2. from __future__ import unicode_literals
  3. # Allow direct execution
  4. import os
  5. import sys
  6. import unittest
  7. sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  8. from youtube_dl.postprocessor import MetadataFromTitlePP
  9. class TestMetadataFromTitle(unittest.TestCase):
  10. def test_format_to_regex(self):
  11. pp = MetadataFromTitlePP(None, '%(title)s - %(artist)s')
  12. self.assertEqual(pp._titleregex, r'(?P<title>.+)\ \-\ (?P<artist>.+)')