mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 05:25:02 +03:00
add unit tests
This commit is contained in:
parent
4aaa73dec7
commit
2b47ccd5d2
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,9 +1,10 @@
|
||||
/build/
|
||||
/dist/
|
||||
/*.egg-info/
|
||||
/MANIFEST
|
||||
*.egg-info/
|
||||
*.py[cod]
|
||||
|
||||
_*/
|
||||
*.py[cod]
|
||||
|
||||
*.download
|
||||
*.cmt.*
|
||||
|
21
MANIFEST
21
MANIFEST
@ -1,21 +0,0 @@
|
||||
# file GENERATED by distutils, do NOT edit
|
||||
CHANGELOG.txt
|
||||
LICENSE.txt
|
||||
Makefile
|
||||
README.md
|
||||
README.txt
|
||||
setup.cfg
|
||||
setup.py
|
||||
you-get
|
||||
you-get.json
|
||||
you_get/__init__.py
|
||||
you_get/common.py
|
||||
you_get/main.py
|
||||
you_get/downloader/__init__.py
|
||||
you_get/downloader/tudou.py
|
||||
you_get/downloader/yinyuetai.py
|
||||
you_get/downloader/youku.py
|
||||
you_get/downloader/youtube.py
|
||||
you_get/processor/__init__.py
|
||||
you_get/processor/merge_flv.py
|
||||
you_get/processor/merge_mp4.py
|
5
Makefile
5
Makefile
@ -4,9 +4,12 @@ SETUP = python3 setup.py
|
||||
|
||||
default: build sdist bdist bdist_egg
|
||||
|
||||
test:
|
||||
$(SETUP) test
|
||||
|
||||
clean:
|
||||
zenity --question
|
||||
rm -fr build/ dist/ *.egg-info/
|
||||
rm -fr build/ dist/ src/*.egg-info/
|
||||
find . | grep __pycache__ | xargs rm -fr
|
||||
|
||||
build:
|
||||
|
@ -152,8 +152,8 @@ In Python 3 (interactive):
|
||||
|
||||
>>> import you_get
|
||||
|
||||
>>> you_get.__version__
|
||||
'0.2'
|
||||
>>> you_get.version.__version__
|
||||
'0.3'
|
||||
|
||||
>>> you_get.youtube_download("http://www.youtube.com/watch?v=8bQlxQJEzLk", info_only = True)
|
||||
Video Site: YouTube.com
|
||||
|
@ -160,8 +160,8 @@ In Python 3 (interactive)::
|
||||
|
||||
>>> import you_get
|
||||
|
||||
>>> you_get.__version__
|
||||
'0.2'
|
||||
>>> you_get.version.__version__
|
||||
'0.3'
|
||||
|
||||
>>> you_get.youtube_download("http://www.youtube.com/watch?v=8bQlxQJEzLk", info_only = True)
|
||||
Video Site: YouTube.com
|
||||
|
12
setup.py
12
setup.py
@ -1,13 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
PROJ_METADATA = 'you-get.json'
|
||||
PROJ_NAME = 'you-get'
|
||||
PACKAGE_NAME = 'you_get'
|
||||
|
||||
PROJ_METADATA = '%s.json' % PROJ_NAME
|
||||
|
||||
import os, json, imp
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
proj_info = json.loads(open(os.path.join(here, PROJ_METADATA)).read())
|
||||
README = open(os.path.join(here, 'README.txt')).read()
|
||||
CHANGELOG = open(os.path.join(here, 'CHANGELOG.txt')).read()
|
||||
VERSION = imp.load_source('version', os.path.join(here, 'you_get/version.py')).__version__
|
||||
VERSION = imp.load_source('version', os.path.join(here, 'src/%s/version.py' % PACKAGE_NAME)).__version__
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
setup(
|
||||
@ -24,7 +27,10 @@ setup(
|
||||
|
||||
long_description = README + '\n\n' + CHANGELOG,
|
||||
|
||||
packages = find_packages(),
|
||||
packages = find_packages('src'),
|
||||
package_dir = {'' : 'src'},
|
||||
|
||||
test_suite = 'tests',
|
||||
|
||||
platforms = 'any',
|
||||
zip_safe = False,
|
||||
|
4
src/you_get/version.py
Normal file
4
src/you_get/version.py
Normal file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__version__ = '0.3.1rc'
|
||||
__date__ = '2013-02-12'
|
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
32
tests/test.py
Normal file
32
tests/test.py
Normal file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import unittest
|
||||
|
||||
from you_get import *
|
||||
from you_get.main import url_to_module
|
||||
|
||||
class YouGetTests(unittest.TestCase):
|
||||
|
||||
def test_googleplus(self):
|
||||
for url in [
|
||||
"http://plus.google.com/111438309227794971277/posts/So6bW37WWtp",
|
||||
"http://plus.google.com/114038303885145553998/posts/7Jkwa35HZu8",
|
||||
"http://plus.google.com/109544372058574620997/posts/Hn9P3Mbuyud",
|
||||
"http://plus.google.com/photos/109544372058574620997/albums/5835145047890484737/5835145057636064194",
|
||||
"http://plus.google.com/102663035987142737445/posts/jJRu43KQFT5",
|
||||
"http://plus.google.com/+%E5%B9%B3%E7%94%B0%E6%A2%A8%E5%A5%88/posts/jJRu43KQFT5",
|
||||
"http://plus.google.com/+平田梨奈/posts/jJRu43KQFT5",
|
||||
"http://plus.google.com/photos/102663035987142737445/albums/5844078581209509505/5844078587839097874",
|
||||
"http://plus.google.com/photos/+%E5%B9%B3%E7%94%B0%E6%A2%A8%E5%A5%88/albums/5844078581209509505/5844078587839097874",
|
||||
"http://plus.google.com/photos/+平田梨奈/albums/5844078581209509505/5844078587839097874",
|
||||
]:
|
||||
url_to_module(url).download(url, info_only = True)
|
||||
|
||||
def test_mixcloud(self):
|
||||
for url in [
|
||||
"http://www.mixcloud.com/beatbopz/beat-bopz-disco-mix/",
|
||||
"http://www.mixcloud.com/beatbopz/tokyo-taste-vol4/",
|
||||
"http://www.mixcloud.com/DJVadim/north-america-are-you-ready/",
|
||||
]:
|
||||
url_to_module(url).download(url, info_only = True)
|
2
you-get
2
you-get
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from you_get import *
|
||||
from src.you_get import *
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__version__ = '0.3.0'
|
||||
__date__ = '2013-02-08'
|
Loading…
Reference in New Issue
Block a user