diff options
author | Jaime Marquínez Ferrándiz <[email protected]> | 2015-03-14 19:55:42 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <[email protected]> | 2015-03-14 20:06:33 +0100 |
commit | 88cf6fb3685c4e012c9f574cbc5f1836c42fc06d (patch) | |
tree | 7a2c2e2f1d69c989866cc34563a5a662ac7ef62e /test | |
parent | e7db87f7000143341505cff812d1fa0371ac901e (diff) | |
download | youtube-dl-88cf6fb3685c4e012c9f574cbc5f1836c42fc06d.tar.gz youtube-dl-88cf6fb3685c4e012c9f574cbc5f1836c42fc06d.zip |
[metadatafromtitle] Some improvements and cleanup
* Remove the 'songtitle' field, 'title' can be used instead.
* Remove newlines in the help text, for consistency with other options.
* Add 'from __future__ import unicode_literals'.
* Call '__init__' from the parent class.
* Add test for the format_to_regex method
Diffstat (limited to 'test')
-rw-r--r-- | test/test_postprocessors.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_postprocessors.py b/test/test_postprocessors.py new file mode 100644 index 000000000..addb69d6f --- /dev/null +++ b/test/test_postprocessors.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +from __future__ import unicode_literals + +# Allow direct execution +import os +import sys +import unittest +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from youtube_dl.postprocessor import MetadataFromTitlePP + + +class TestMetadataFromTitle(unittest.TestCase): + def test_format_to_regex(self): + pp = MetadataFromTitlePP(None, '%(title)s - %(artist)s') + self.assertEqual(pp._titleregex, '(?P<title>.+)\ \-\ (?P<artist>.+)') |