1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

tests: add 'importorskip' for tests that require 'extra' dependencies, (youtube-dl, socks), addresses #270

setup: remove 2.6 classifier, update repo path
bump to 2.0.1
This commit is contained in:
Ilya Kreymer 2018-01-30 18:26:53 -08:00
parent 610b6414a3
commit e2fa14bc2d
6 changed files with 10 additions and 8 deletions

View File

@ -1,4 +1,4 @@
__version__ = '2.0.0'
__version__ = '2.0.1'
DEFAULT_CONFIG = 'pywb/default_config.yaml'

View File

@ -6,8 +6,8 @@ from pywb.warcserver.test.testutils import FakeRedisTests
import os
import webtest
import pytest
from pytest import raises
from fakeredis import FakeStrictRedis
from pywb.recorder.recorderapp import RecorderApp
@ -607,6 +607,7 @@ class TestRecorder(LiveServerTests, FakeRedisTests, TempDirTests, BaseTestClass)
assert len(writer.fh_cache) == 0
def test_record_video_metadata(self):
pytest.importorskip('youtube-dl')
warc_path = to_path(self.root_dir + '/warcs/{user}/{coll}/')
dedup_index = self._get_dedup_index()

View File

@ -7,6 +7,7 @@ from six.moves.urllib.parse import urlencode
import webtest
from fakeredis import FakeStrictRedis
from mock import patch
import pytest
import json
@ -380,6 +381,7 @@ foo=bar&test=abc"""
assert resp.headers['Memento-Datetime'] == 'Mon, 29 Jul 2013 19:51:51 GMT'
def test_live_video_loader(self):
pytest.importorskip('youtube-dl')
params = {'url': 'http://www.youtube.com/v/BfBgWtAIbRc',
'content_type': 'application/vnd.youtube-dl_formats+json'
}
@ -397,6 +399,7 @@ foo=bar&test=abc"""
assert b'Content-Type: application/vnd.youtube-dl_formats+json' in resp.body
def test_live_video_loader_post(self):
pytest.importorskip('youtube-dl')
req_data = """\
GET /v/BfBgWtAIbRc HTTP/1.1
accept-encoding: gzip, deflate

View File

@ -79,7 +79,7 @@ generate_git_hash_py('pywb')
setup(
name='pywb',
version=__version__,
url='https://github.com/ikreymer/pywb',
url='https://github.com/webrecorder/pywb',
author='Ilya Kreymer',
author_email='ikreymer@gmail.com',
description='Pywb Webrecorder web archive replay and capture tools',
@ -100,9 +100,6 @@ setup(
glob.glob('sample_archive/text_content/*')),
],
install_requires=load_requirements('requirements.txt'),
dependency_links=[
#'git+https://github.com/t0m/pyamf.git@python3#egg=pyamf-0.8.0'
],
tests_require=[
'pytest',
'WebTest',
@ -130,7 +127,6 @@ setup(
'License :: OSI Approved :: GNU General Public License (GPL)',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',

View File

@ -1,4 +1,5 @@
from .base_config_test import BaseConfigTest, fmod_sl
import pytest
# ============================================================================
@ -53,6 +54,7 @@ class TestLiveRewriter(BaseConfigTest):
assert resp.status_int == 400
def test_live_video_info(self):
pytest.importorskip('youtube-dl')
resp = self.testapp.get('/live/vi_/https://www.youtube.com/watch?v=DjFZyFWSt1M')
assert resp.status_int == 200
assert resp.content_type == 'application/vnd.youtube-dl_formats+json', resp.content_type

View File

@ -11,6 +11,7 @@ import pytest
class TestSOCKSProxy(BaseConfigTest):
@classmethod
def setup_class(cls):
pytest.importorskip('socks')
os.environ['SOCKS_HOST'] = 'localhost'
os.environ['SOCKS_PORT'] = '0'
@ -30,7 +31,6 @@ class TestSOCKSProxy(BaseConfigTest):
}
def test_socks_attempt_connect(self, fmod_sl):
pytest.importorskip('socks')
# no proxy is set, expect to fail if socks is being used
resp = self.get('/live/{0}http://httpbin.org/get', fmod_sl, status=400)
assert resp.status_int == 400