[skip travis] renaming

to avoid using same folder when using pip install for example
This commit is contained in:
Unknown
2020-09-02 20:25:25 +02:00
parent 9688f23716
commit cefecac12c
861 changed files with 452 additions and 452 deletions

View File

@@ -10,13 +10,13 @@ import types
import ssl
import sys
import youtube_dl.extractor
from youtube_dl import YoutubeDL
from youtube_dl.compat import (
import youtube_dlc.extractor
from youtube_dlc import YoutubeDL
from youtube_dlc.compat import (
compat_os_name,
compat_str,
)
from youtube_dl.utils import (
from youtube_dlc.utils import (
preferredencoding,
write_string,
)
@@ -90,7 +90,7 @@ class FakeYDL(YoutubeDL):
def gettestcases(include_onlymatching=False):
for ie in youtube_dl.extractor.gen_extractors():
for ie in youtube_dlc.extractor.gen_extractors():
for tc in ie.get_testcases(include_onlymatching):
yield tc

View File

@@ -10,10 +10,10 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL, expect_dict, expect_value, http_server_port
from youtube_dl.compat import compat_etree_fromstring, compat_http_server
from youtube_dl.extractor.common import InfoExtractor
from youtube_dl.extractor import YoutubeIE, get_info_extractor
from youtube_dl.utils import encode_data_uri, strip_jsonp, ExtractorError, RegexNotFoundError
from youtube_dlc.compat import compat_etree_fromstring, compat_http_server
from youtube_dlc.extractor.common import InfoExtractor
from youtube_dlc.extractor import YoutubeIE, get_info_extractor
from youtube_dlc.utils import encode_data_uri, strip_jsonp, ExtractorError, RegexNotFoundError
import threading

View File

@@ -12,12 +12,12 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import copy
from test.helper import FakeYDL, assertRegexpMatches
from youtube_dl import YoutubeDL
from youtube_dl.compat import compat_str, compat_urllib_error
from youtube_dl.extractor import YoutubeIE
from youtube_dl.extractor.common import InfoExtractor
from youtube_dl.postprocessor.common import PostProcessor
from youtube_dl.utils import ExtractorError, match_filter_func
from youtube_dlc import YoutubeDL
from youtube_dlc.compat import compat_str, compat_urllib_error
from youtube_dlc.extractor import YoutubeIE
from youtube_dlc.extractor.common import InfoExtractor
from youtube_dlc.postprocessor.common import PostProcessor
from youtube_dlc.utils import ExtractorError, match_filter_func
TEST_URL = 'http://localhost/sample.mp4'

View File

@@ -10,7 +10,7 @@ import tempfile
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.utils import YoutubeDLCookieJar
from youtube_dlc.utils import YoutubeDLCookieJar
class TestYoutubeDLCookieJar(unittest.TestCase):

View File

@@ -8,8 +8,8 @@ import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text
from youtube_dl.utils import bytes_to_intlist, intlist_to_bytes
from youtube_dlc.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text
from youtube_dlc.utils import bytes_to_intlist, intlist_to_bytes
import base64
# the encrypted data can be generate with 'devscripts/generate_aes_testdata.py'

View File

@@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import try_rm
from youtube_dl import YoutubeDL
from youtube_dlc import YoutubeDL
def _download_restricted(url, filename, age):

View File

@@ -12,7 +12,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import gettestcases
from youtube_dl.extractor import (
from youtube_dlc.extractor import (
FacebookIE,
gen_extractors,
YoutubeIE,
@@ -70,7 +70,7 @@ class TestAllURLsMatching(unittest.TestCase):
def test_youtube_search_matching(self):
self.assertMatch('http://www.youtube.com/results?search_query=making+mustard', ['youtube:search_url'])
self.assertMatch('https://www.youtube.com/results?baz=bar&search_query=youtube-dl+test+video&filters=video&lclk=video', ['youtube:search_url'])
self.assertMatch('https://www.youtube.com/results?baz=bar&search_query=youtube-dlc+test+video&filters=video&lclk=video', ['youtube:search_url'])
def test_youtube_extract(self):
assertExtractId = lambda url, id: self.assertEqual(YoutubeIE.extract_id(url), id)

View File

@@ -13,7 +13,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL
from youtube_dl.cache import Cache
from youtube_dlc.cache import Cache
def _is_empty(d):

View File

@@ -10,7 +10,7 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.compat import (
from youtube_dlc.compat import (
compat_getenv,
compat_setenv,
compat_etree_Element,
@@ -28,11 +28,11 @@ from youtube_dl.compat import (
class TestCompat(unittest.TestCase):
def test_compat_getenv(self):
test_str = 'тест'
compat_setenv('YOUTUBE_DL_COMPAT_GETENV', test_str)
self.assertEqual(compat_getenv('YOUTUBE_DL_COMPAT_GETENV'), test_str)
compat_setenv('youtube_dlc_COMPAT_GETENV', test_str)
self.assertEqual(compat_getenv('youtube_dlc_COMPAT_GETENV'), test_str)
def test_compat_setenv(self):
test_var = 'YOUTUBE_DL_COMPAT_SETENV'
test_var = 'youtube_dlc_COMPAT_SETENV'
test_str = 'тест'
compat_setenv(test_var, test_str)
compat_getenv(test_var)
@@ -46,11 +46,11 @@ class TestCompat(unittest.TestCase):
compat_setenv('HOME', old_home or '')
def test_all_present(self):
import youtube_dl.compat
all_names = youtube_dl.compat.__all__
import youtube_dlc.compat
all_names = youtube_dlc.compat.__all__
present_names = set(filter(
lambda c: '_' in c and not c.startswith('_'),
dir(youtube_dl.compat))) - set(['unicode_literals'])
dir(youtube_dlc.compat))) - set(['unicode_literals'])
self.assertEqual(all_names, sorted(present_names))
def test_compat_urllib_parse_unquote(self):

View File

@@ -24,24 +24,24 @@ import io
import json
import socket
import youtube_dl.YoutubeDL
from youtube_dl.compat import (
import youtube_dlc.YoutubeDL
from youtube_dlc.compat import (
compat_http_client,
compat_urllib_error,
compat_HTTPError,
)
from youtube_dl.utils import (
from youtube_dlc.utils import (
DownloadError,
ExtractorError,
format_bytes,
UnavailableVideoError,
)
from youtube_dl.extractor import get_info_extractor
from youtube_dlc.extractor import get_info_extractor
RETRIES = 3
class YoutubeDL(youtube_dl.YoutubeDL):
class YoutubeDL(youtube_dlc.YoutubeDL):
def __init__(self, *args, **kwargs):
self.to_stderr = self.to_screen
self.processed_info_dicts = []
@@ -92,7 +92,7 @@ class TestDownload(unittest.TestCase):
def generator(test_case, tname):
def test_template(self):
ie = youtube_dl.extractor.get_info_extractor(test_case['name'])()
ie = youtube_dlc.extractor.get_info_extractor(test_case['name'])()
other_ies = [get_info_extractor(ie_key)() for ie_key in test_case.get('add_ie', [])]
is_playlist = any(k.startswith('playlist') for k in test_case)
test_cases = test_case.get(

View File

@@ -10,10 +10,10 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import http_server_port, try_rm
from youtube_dl import YoutubeDL
from youtube_dl.compat import compat_http_server
from youtube_dl.downloader.http import HttpFD
from youtube_dl.utils import encodeFilename
from youtube_dlc import YoutubeDL
from youtube_dlc.compat import compat_http_server
from youtube_dlc.downloader.http import HttpFD
from youtube_dlc.utils import encodeFilename
import threading
TEST_DIR = os.path.dirname(os.path.abspath(__file__))

View File

@@ -10,7 +10,7 @@ import os
import subprocess
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.utils import encodeArgument
from youtube_dlc.utils import encodeArgument
rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -23,18 +23,18 @@ except AttributeError:
class TestExecution(unittest.TestCase):
def test_import(self):
subprocess.check_call([sys.executable, '-c', 'import youtube_dl'], cwd=rootDir)
subprocess.check_call([sys.executable, '-c', 'import youtube_dlc'], cwd=rootDir)
def test_module_exec(self):
if sys.version_info >= (2, 7): # Python 2.6 doesn't support package execution
subprocess.check_call([sys.executable, '-m', 'youtube_dl', '--version'], cwd=rootDir, stdout=_DEV_NULL)
subprocess.check_call([sys.executable, '-m', 'youtube_dlc', '--version'], cwd=rootDir, stdout=_DEV_NULL)
def test_main_exec(self):
subprocess.check_call([sys.executable, 'youtube_dl/__main__.py', '--version'], cwd=rootDir, stdout=_DEV_NULL)
subprocess.check_call([sys.executable, 'youtube_dlc/__main__.py', '--version'], cwd=rootDir, stdout=_DEV_NULL)
def test_cmdline_umlauts(self):
p = subprocess.Popen(
[sys.executable, 'youtube_dl/__main__.py', encodeArgument('ä'), '--version'],
[sys.executable, 'youtube_dlc/__main__.py', encodeArgument('ä'), '--version'],
cwd=rootDir, stdout=_DEV_NULL, stderr=subprocess.PIPE)
_, stderr = p.communicate()
self.assertFalse(stderr)

View File

@@ -9,8 +9,8 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import http_server_port
from youtube_dl import YoutubeDL
from youtube_dl.compat import compat_http_server, compat_urllib_request
from youtube_dlc import YoutubeDL
from youtube_dlc.compat import compat_http_server, compat_urllib_request
import ssl
import threading

View File

@@ -9,7 +9,7 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL
from youtube_dl.extractor import IqiyiIE
from youtube_dlc.extractor import IqiyiIE
class IqiyiIEWithCredentials(IqiyiIE):

View File

@@ -8,7 +8,7 @@ import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.jsinterp import JSInterpreter
from youtube_dlc.jsinterp import JSInterpreter
class TestJSInterpreter(unittest.TestCase):

View File

@@ -7,7 +7,7 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.extractor import (
from youtube_dlc.extractor import (
gen_extractors,
)

View File

@@ -8,7 +8,7 @@ import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.options import _hide_login_info
from youtube_dlc.options import _hide_login_info
class TestOptions(unittest.TestCase):

View File

@@ -8,7 +8,7 @@ import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.postprocessor import MetadataFromTitlePP
from youtube_dlc.postprocessor import MetadataFromTitlePP
class TestMetadataFromTitle(unittest.TestCase):

View File

@@ -15,7 +15,7 @@ from test.helper import (
FakeYDL,
get_params,
)
from youtube_dl.compat import (
from youtube_dlc.compat import (
compat_str,
compat_urllib_request,
)

View File

@@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL, md5
from youtube_dl.extractor import (
from youtube_dlc.extractor import (
YoutubeIE,
DailymotionIE,
TEDIE,

View File

@@ -14,7 +14,7 @@ import json
import re
import subprocess
from youtube_dl.swfinterp import SWFInterpreter
from youtube_dlc.swfinterp import SWFInterpreter
TEST_DIR = os.path.join(

View File

@@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import json
from youtube_dl.update import rsa_verify
from youtube_dlc.update import rsa_verify
class TestUpdate(unittest.TestCase):

View File

@@ -15,7 +15,7 @@ import io
import json
import xml.etree.ElementTree
from youtube_dl.utils import (
from youtube_dlc.utils import (
age_restricted,
args_to_str,
encode_base_n,
@@ -105,7 +105,7 @@ from youtube_dl.utils import (
cli_bool_option,
parse_codecs,
)
from youtube_dl.compat import (
from youtube_dlc.compat import (
compat_chr,
compat_etree_fromstring,
compat_getenv,
@@ -240,12 +240,12 @@ class TestUtil(unittest.TestCase):
def env(var):
return '%{0}%'.format(var) if sys.platform == 'win32' else '${0}'.format(var)
compat_setenv('YOUTUBE_DL_EXPATH_PATH', 'expanded')
self.assertEqual(expand_path(env('YOUTUBE_DL_EXPATH_PATH')), 'expanded')
compat_setenv('youtube_dlc_EXPATH_PATH', 'expanded')
self.assertEqual(expand_path(env('youtube_dlc_EXPATH_PATH')), 'expanded')
self.assertEqual(expand_path(env('HOME')), compat_getenv('HOME'))
self.assertEqual(expand_path('~'), compat_getenv('HOME'))
self.assertEqual(
expand_path('~/%s' % env('YOUTUBE_DL_EXPATH_PATH')),
expand_path('~/%s' % env('youtube_dlc_EXPATH_PATH')),
'%s/expanded' % compat_getenv('HOME'))
def test_prepend_extension(self):
@@ -1388,8 +1388,8 @@ Line 1
self.assertEqual(caesar('ebg', 'acegik', -2), 'abc')
def test_rot47(self):
self.assertEqual(rot47('youtube-dl'), r'J@FEF36\5=')
self.assertEqual(rot47('YOUTUBE-DL'), r'*~&%&qt\s{')
self.assertEqual(rot47('youtube-dlc'), r'J@FEF36\5=')
self.assertEqual(rot47('youtube-dlc'), r'*~&%&qt\s{')
def test_urshift(self):
self.assertEqual(urshift(3, 1), 1)

View File

@@ -17,7 +17,7 @@ class TestVerboseOutput(unittest.TestCase):
def test_private_info_arg(self):
outp = subprocess.Popen(
[
sys.executable, 'youtube_dl/__main__.py', '-v',
sys.executable, 'youtube_dlc/__main__.py', '-v',
'--username', 'johnsmith@gmail.com',
'--password', 'secret',
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -30,7 +30,7 @@ class TestVerboseOutput(unittest.TestCase):
def test_private_info_shortarg(self):
outp = subprocess.Popen(
[
sys.executable, 'youtube_dl/__main__.py', '-v',
sys.executable, 'youtube_dlc/__main__.py', '-v',
'-u', 'johnsmith@gmail.com',
'-p', 'secret',
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -43,7 +43,7 @@ class TestVerboseOutput(unittest.TestCase):
def test_private_info_eq(self):
outp = subprocess.Popen(
[
sys.executable, 'youtube_dl/__main__.py', '-v',
sys.executable, 'youtube_dlc/__main__.py', '-v',
'--username=johnsmith@gmail.com',
'--password=secret',
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -56,7 +56,7 @@ class TestVerboseOutput(unittest.TestCase):
def test_private_info_shortarg_eq(self):
outp = subprocess.Popen(
[
sys.executable, 'youtube_dl/__main__.py', '-v',
sys.executable, 'youtube_dlc/__main__.py', '-v',
'-u=johnsmith@gmail.com',
'-p=secret',
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

View File

@@ -15,11 +15,11 @@ import io
import xml.etree.ElementTree
import youtube_dl.YoutubeDL
import youtube_dl.extractor
import youtube_dlc.YoutubeDL
import youtube_dlc.extractor
class YoutubeDL(youtube_dl.YoutubeDL):
class YoutubeDL(youtube_dlc.YoutubeDL):
def __init__(self, *args, **kwargs):
super(YoutubeDL, self).__init__(*args, **kwargs)
self.to_stderr = self.to_screen
@@ -45,7 +45,7 @@ class TestAnnotations(unittest.TestCase):
def test_info_json(self):
expected = list(EXPECTED_ANNOTATIONS) # Two annotations could have the same text.
ie = youtube_dl.extractor.YoutubeIE()
ie = youtube_dlc.extractor.YoutubeIE()
ydl = YoutubeDL(params)
ydl.add_info_extractor(ie)
ydl.download([TEST_ID])

View File

@@ -9,7 +9,7 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import expect_value
from youtube_dl.extractor import YoutubeIE
from youtube_dlc.extractor import YoutubeIE
class TestYoutubeChapters(unittest.TestCase):

View File

@@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL
from youtube_dl.extractor import (
from youtube_dlc.extractor import (
YoutubePlaylistIE,
YoutubeIE,
)

View File

@@ -13,8 +13,8 @@ import re
import string
from test.helper import FakeYDL
from youtube_dl.extractor import YoutubeIE
from youtube_dl.compat import compat_str, compat_urlretrieve
from youtube_dlc.extractor import YoutubeIE
from youtube_dlc.compat import compat_str, compat_urlretrieve
_TESTS = [
(