提交 7f2f2035 编写于 作者: M Mort Yao

fix tests

上级 13d40fa6
......@@ -941,7 +941,7 @@ def url_to_module(url):
'baidu': baidu,
'bilibili': bilibili,
'blip': blip,
'catfun':catfun,
'catfun': catfun,
'cntv': cntv,
'cbs': cbs,
'coursera': coursera,
......@@ -961,8 +961,8 @@ def url_to_module(url):
'kankanews': bilibili,
'khanacademy': khan,
'ku6': ku6,
'kugou':kugou,
'kuwo':kuwo,
'kugou': kugou,
'kuwo': kuwo,
'letv': letv,
'magisto': magisto,
'miomio': miomio,
......@@ -974,7 +974,7 @@ def url_to_module(url):
'sina': sina,
'smgbb': bilibili,
'sohu': sohu,
'songtaste':songtaste,
'songtaste': songtaste,
'soundcloud': soundcloud,
'ted': ted,
'theplatform': theplatform,
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from you_get import *
from you_get.extractor.__main__ import url_to_module
def test_urls(urls):
for url in urls:
url_to_module(url)[0].download(url, info_only = True)
from you_get.extractors import *
from you_get.common import *
class YouGetTests(unittest.TestCase):
def test_freesound(self):
test_urls([
"http://www.freesound.org/people/Corsica_S/sounds/184419/",
])
freesound.download("http://www.freesound.org/people/Corsica_S/sounds/184419/", info_only=True)
def test_magisto(self):
test_urls([
"http://www.magisto.com/album/video/f3x9AAQORAkfDnIFDA",
])
magisto.download("http://www.magisto.com/album/video/f3x9AAQORAkfDnIFDA", info_only=True)
def test_mixcloud(self):
test_urls([
"http://www.mixcloud.com/beatbopz/beat-bopz-disco-mix/",
"http://www.mixcloud.com/DJVadim/north-america-are-you-ready/",
])
mixcloud.download("http://www.mixcloud.com/beatbopz/beat-bopz-disco-mix/", info_only=True)
mixcloud.download("http://www.mixcloud.com/DJVadim/north-america-are-you-ready/", info_only=True)
def test_ted(self):
test_urls([
"http://www.ted.com/talks/jennifer_lin_improvs_piano_magic.html",
"http://www.ted.com/talks/derek_paravicini_and_adam_ockelford_in_the_key_of_genius.html",
])
ted.download("http://www.ted.com/talks/jennifer_lin_improvs_piano_magic.html", info_only=True)
ted.download("http://www.ted.com/talks/derek_paravicini_and_adam_ockelford_in_the_key_of_genius.html", info_only=True)
def test_vimeo(self):
test_urls([
"http://vimeo.com/56810854",
])
vimeo.download("http://vimeo.com/56810854", info_only=True)
def test_youtube(self):
test_urls([
"http://www.youtube.com/watch?v=pzKerr0JIPA",
"http://youtu.be/pzKerr0JIPA",
"http://www.youtube.com/attribution_link?u=/watch?v%3DldAKIzq7bvs%26feature%3Dshare"
])
youtube.download("http://www.youtube.com/watch?v=pzKerr0JIPA", info_only=True)
youtube.download("http://youtu.be/pzKerr0JIPA", info_only=True)
youtube.download("http://www.youtube.com/attribution_link?u=/watch?v%3DldAKIzq7bvs%26feature%3Dshare", info_only=True)
......@@ -2,7 +2,7 @@
import unittest
from you_get import *
from you_get.common import *
class TestCommon(unittest.TestCase):
......
......@@ -2,7 +2,7 @@
import unittest
from you_get.util import *
from you_get.util.fs import *
class TestUtil(unittest.TestCase):
def test_legitimize(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册