You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
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>.+)')