mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 13:35:16 +03:00
fix tests
This commit is contained in:
parent
13d40fa694
commit
7f2f203510
@ -941,7 +941,7 @@ def url_to_module(url):
|
|||||||
'baidu': baidu,
|
'baidu': baidu,
|
||||||
'bilibili': bilibili,
|
'bilibili': bilibili,
|
||||||
'blip': blip,
|
'blip': blip,
|
||||||
'catfun':catfun,
|
'catfun': catfun,
|
||||||
'cntv': cntv,
|
'cntv': cntv,
|
||||||
'cbs': cbs,
|
'cbs': cbs,
|
||||||
'coursera': coursera,
|
'coursera': coursera,
|
||||||
@ -961,8 +961,8 @@ def url_to_module(url):
|
|||||||
'kankanews': bilibili,
|
'kankanews': bilibili,
|
||||||
'khanacademy': khan,
|
'khanacademy': khan,
|
||||||
'ku6': ku6,
|
'ku6': ku6,
|
||||||
'kugou':kugou,
|
'kugou': kugou,
|
||||||
'kuwo':kuwo,
|
'kuwo': kuwo,
|
||||||
'letv': letv,
|
'letv': letv,
|
||||||
'magisto': magisto,
|
'magisto': magisto,
|
||||||
'miomio': miomio,
|
'miomio': miomio,
|
||||||
@ -974,7 +974,7 @@ def url_to_module(url):
|
|||||||
'sina': sina,
|
'sina': sina,
|
||||||
'smgbb': bilibili,
|
'smgbb': bilibili,
|
||||||
'sohu': sohu,
|
'sohu': sohu,
|
||||||
'songtaste':songtaste,
|
'songtaste': songtaste,
|
||||||
'soundcloud': soundcloud,
|
'soundcloud': soundcloud,
|
||||||
'ted': ted,
|
'ted': ted,
|
||||||
'theplatform': theplatform,
|
'theplatform': theplatform,
|
||||||
|
@ -1,47 +1,31 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from you_get import *
|
from you_get import *
|
||||||
from you_get.extractor.__main__ import url_to_module
|
from you_get.extractors import *
|
||||||
|
from you_get.common import *
|
||||||
def test_urls(urls):
|
|
||||||
for url in urls:
|
|
||||||
url_to_module(url)[0].download(url, info_only = True)
|
|
||||||
|
|
||||||
class YouGetTests(unittest.TestCase):
|
class YouGetTests(unittest.TestCase):
|
||||||
|
|
||||||
def test_freesound(self):
|
def test_freesound(self):
|
||||||
test_urls([
|
freesound.download("http://www.freesound.org/people/Corsica_S/sounds/184419/", info_only=True)
|
||||||
"http://www.freesound.org/people/Corsica_S/sounds/184419/",
|
|
||||||
])
|
|
||||||
|
|
||||||
def test_magisto(self):
|
def test_magisto(self):
|
||||||
test_urls([
|
magisto.download("http://www.magisto.com/album/video/f3x9AAQORAkfDnIFDA", info_only=True)
|
||||||
"http://www.magisto.com/album/video/f3x9AAQORAkfDnIFDA",
|
|
||||||
])
|
|
||||||
|
|
||||||
def test_mixcloud(self):
|
def test_mixcloud(self):
|
||||||
test_urls([
|
mixcloud.download("http://www.mixcloud.com/beatbopz/beat-bopz-disco-mix/", info_only=True)
|
||||||
"http://www.mixcloud.com/beatbopz/beat-bopz-disco-mix/",
|
mixcloud.download("http://www.mixcloud.com/DJVadim/north-america-are-you-ready/", info_only=True)
|
||||||
"http://www.mixcloud.com/DJVadim/north-america-are-you-ready/",
|
|
||||||
])
|
|
||||||
|
|
||||||
def test_ted(self):
|
def test_ted(self):
|
||||||
test_urls([
|
ted.download("http://www.ted.com/talks/jennifer_lin_improvs_piano_magic.html", info_only=True)
|
||||||
"http://www.ted.com/talks/jennifer_lin_improvs_piano_magic.html",
|
ted.download("http://www.ted.com/talks/derek_paravicini_and_adam_ockelford_in_the_key_of_genius.html", info_only=True)
|
||||||
"http://www.ted.com/talks/derek_paravicini_and_adam_ockelford_in_the_key_of_genius.html",
|
|
||||||
])
|
|
||||||
|
|
||||||
def test_vimeo(self):
|
def test_vimeo(self):
|
||||||
test_urls([
|
vimeo.download("http://vimeo.com/56810854", info_only=True)
|
||||||
"http://vimeo.com/56810854",
|
|
||||||
])
|
|
||||||
|
|
||||||
def test_youtube(self):
|
def test_youtube(self):
|
||||||
test_urls([
|
youtube.download("http://www.youtube.com/watch?v=pzKerr0JIPA", info_only=True)
|
||||||
"http://www.youtube.com/watch?v=pzKerr0JIPA",
|
youtube.download("http://youtu.be/pzKerr0JIPA", info_only=True)
|
||||||
"http://youtu.be/pzKerr0JIPA",
|
youtube.download("http://www.youtube.com/attribution_link?u=/watch?v%3DldAKIzq7bvs%26feature%3Dshare", info_only=True)
|
||||||
"http://www.youtube.com/attribution_link?u=/watch?v%3DldAKIzq7bvs%26feature%3Dshare"
|
|
||||||
])
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from you_get import *
|
from you_get.common import *
|
||||||
|
|
||||||
class TestCommon(unittest.TestCase):
|
class TestCommon(unittest.TestCase):
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from you_get.util import *
|
from you_get.util.fs import *
|
||||||
|
|
||||||
class TestUtil(unittest.TestCase):
|
class TestUtil(unittest.TestCase):
|
||||||
def test_legitimize(self):
|
def test_legitimize(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user