diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-12-17 04:13:36 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-12-17 04:13:36 +0100 |
commit | 29eb5174031cfc0b5de556da3da7761ac377de4e (patch) | |
tree | bdc0158bbf6a069777719d70c89b96939c1c651a /test | |
parent | 44c471c3b873473157adb8ba8a55667ab54b2602 (diff) |
Add webpage_url_basename info_dict field (Fixes #1938)
Diffstat (limited to 'test')
-rw-r--r-- | test/test_utils.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index 0fa66beec..5f4fdb771 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -13,20 +13,21 @@ import xml.etree.ElementTree #from youtube_dl.utils import htmlentity_transform from youtube_dl.utils import ( - timeconvert, - sanitize_filename, - unescapeHTML, - orderedSet, DateRange, - unified_strdate, + encodeFilename, find_xpath_attr, get_meta_content, - xpath_with_ns, - smuggle_url, - unsmuggle_url, + orderedSet, + sanitize_filename, shell_quote, - encodeFilename, + smuggle_url, str_to_int, + timeconvert, + unescapeHTML, + unified_strdate, + unsmuggle_url, + url_basename, + xpath_with_ns, ) if sys.version_info < (3, 0): @@ -181,6 +182,12 @@ class TestUtil(unittest.TestCase): self.assertEqual(str_to_int('123,456'), 123456) self.assertEqual(str_to_int('123.456'), 123456) + def test_url_basename(self): + self.assertEqual(url_basename(u'http://foo.de/'), u'') + self.assertEqual(url_basename(u'http://foo.de/bar/baz'), u'baz') + self.assertEqual(url_basename(u'http://foo.de/bar/baz?x=y'), u'baz') + self.assertEqual(url_basename(u'http://foo.de/bar/baz#x=y'), u'baz') + self.assertEqual(url_basename(u'http://foo.de/bar/baz/'), u'baz') if __name__ == '__main__': unittest.main() |