From 6e899f1dab3d1fc6585ffe6baa77ef3838f7d728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Mon, 23 Dec 2013 11:12:10 +0100 Subject: [PATCH] [YoutubeDL-tests] Fix test_format_limit We modify the original info_dict now, we must use a copy. --- test/test_YoutubeDL.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py index 3100c362a..d251c274c 100644 --- a/test/test_YoutubeDL.py +++ b/test/test_YoutubeDL.py @@ -68,22 +68,22 @@ class TestFormatSelection(unittest.TestCase): {u'format_id': u'great', u'url': u'http://example.com/great'}, {u'format_id': u'excellent', u'url': u'http://example.com/exc'}, ] - info_dict = { + info_dict = lambda:{ u'formats': formats, u'extractor': u'test', 'id': 'testvid'} ydl = YDL() - ydl.process_ie_result(info_dict) + ydl.process_ie_result(info_dict()) downloaded = ydl.downloaded_info_dicts[0] self.assertEqual(downloaded[u'format_id'], u'excellent') ydl = YDL({'format_limit': 'good'}) assert ydl.params['format_limit'] == 'good' - ydl.process_ie_result(info_dict) + ydl.process_ie_result(info_dict()) downloaded = ydl.downloaded_info_dicts[0] self.assertEqual(downloaded[u'format_id'], u'good') ydl = YDL({'format_limit': 'great', 'format': 'all'}) - ydl.process_ie_result(info_dict) + ydl.process_ie_result(info_dict()) self.assertEqual(ydl.downloaded_info_dicts[0][u'format_id'], u'meh') self.assertEqual(ydl.downloaded_info_dicts[1][u'format_id'], u'good') self.assertEqual(ydl.downloaded_info_dicts[2][u'format_id'], u'great') @@ -91,7 +91,7 @@ class TestFormatSelection(unittest.TestCase): ydl = YDL() ydl.params['format_limit'] = 'excellent' - ydl.process_ie_result(info_dict) + ydl.process_ie_result(info_dict()) downloaded = ydl.downloaded_info_dicts[0] self.assertEqual(downloaded[u'format_id'], u'excellent')