aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-08-25 18:03:01 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-08-25 18:03:01 +0200
commit0990305d2acc4c1b7869dae2773c1f24125804bd (patch)
tree629d42ba5f42c637d875299f95a864b34d27fba7 /test
parent829476b80a86819c79511f60f4fc25f09ab186b7 (diff)
downloadyoutube-dl-0990305d2acc4c1b7869dae2773c1f24125804bd.tar.xz
[generic] Fix rss under Python 2.x and move test to extractor
Diffstat (limited to 'test')
-rw-r--r--test/helper.py5
-rw-r--r--test/test_download.py4
-rw-r--r--test/test_playlists.py9
3 files changed, 7 insertions, 11 deletions
diff --git a/test/helper.py b/test/helper.py
index 22d763860..01b11f661 100644
--- a/test/helper.py
+++ b/test/helper.py
@@ -102,7 +102,10 @@ def expect_info_dict(self, expected_dict, got_dict):
match_rex = re.compile(match_str)
self.assertTrue(
- isinstance(got, compat_str) and match_rex.match(got),
+ isinstance(got, compat_str),
+ 'Expected a %r object, but got %r' % (compat_str, type(got)))
+ self.assertTrue(
+ match_rex.match(got),
u'field %s (value: %r) should match %r' % (info_field, got, match_str))
elif isinstance(expected, type):
got = got_dict.get(info_field)
diff --git a/test/test_download.py b/test/test_download.py
index 5d24300f1..6422ef119 100644
--- a/test/test_download.py
+++ b/test/test_download.py
@@ -7,6 +7,7 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import (
+ assertGreaterEqual,
get_params,
gettestcases,
expect_info_dict,
@@ -136,7 +137,8 @@ def generator(test_case):
self.assertEqual(res_dict['_type'], 'playlist')
expect_info_dict(self, test_case.get('info_dict', {}), res_dict)
if 'playlist_mincount' in test_case:
- self.assertGreaterEqual(
+ assertGreaterEqual(
+ self,
len(res_dict['entries']),
test_case['playlist_mincount'],
'Expected at least %d in playlist %s, but got only %d' % (
diff --git a/test/test_playlists.py b/test/test_playlists.py
index 21583aeed..0137b8399 100644
--- a/test/test_playlists.py
+++ b/test/test_playlists.py
@@ -310,15 +310,6 @@ class TestPlaylists(unittest.TestCase):
self.assertEqual(result['title'], 'Always/Never: A Little-Seen Movie About Nuclear Command and Control : The New Yorker')
self.assertEqual(len(result['entries']), 3)
- def test_generic_rss_feed(self):
- dl = FakeYDL()
- ie = GenericIE(dl)
- result = ie.extract('http://phihag.de/2014/youtube-dl/rss.xml')
- self.assertIsPlaylist(result)
- self.assertEqual(result['id'], 'http://phihag.de/2014/youtube-dl/rss.xml')
- self.assertEqual(result['title'], 'Zero Punctuation')
- self.assertTrue(len(result['entries']) > 10)
-
def test_ted_playlist(self):
dl = FakeYDL()
ie = TEDIE(dl)