moved tests into the lbrynet package
This commit is contained in:
parent
42a141e7b7
commit
2abe85ba25
53 changed files with 32 additions and 31 deletions
|
@ -39,7 +39,7 @@ script:
|
||||||
- pip install cython
|
- pip install cython
|
||||||
- pip install mock pylint unqlite
|
- pip install mock pylint unqlite
|
||||||
- pylint lbrynet
|
- pylint lbrynet
|
||||||
- PYTHONPATH=. trial tests
|
- PYTHONPATH=. trial lbrynet.tests
|
||||||
- python -m unittest discover tests/integration
|
- python -m unittest discover lbrynet/tests/integration
|
||||||
- rvm install ruby-2.3.1
|
- rvm install ruby-2.3.1
|
||||||
- rvm use 2.3.1 && gem install danger --version '~> 4.0' && danger
|
- rvm use 2.3.1 && gem install danger --version '~> 4.0' && danger
|
||||||
|
|
|
@ -27,6 +27,7 @@ at anytime.
|
||||||
### Changed
|
### Changed
|
||||||
* Announcing by head blob is turned on by default
|
* Announcing by head blob is turned on by default
|
||||||
* Updated reflector server dns
|
* Updated reflector server dns
|
||||||
|
* Moved tests into the lbrynet package.
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
* Added WAL pragma to sqlite3
|
* Added WAL pragma to sqlite3
|
||||||
|
|
|
@ -32,8 +32,8 @@ from lbrynet.core.RateLimiter import DummyRateLimiter, RateLimiter
|
||||||
from lbrynet.core.server.BlobRequestHandler import BlobRequestHandlerFactory
|
from lbrynet.core.server.BlobRequestHandler import BlobRequestHandlerFactory
|
||||||
from lbrynet.core.server.ServerProtocol import ServerProtocolFactory
|
from lbrynet.core.server.ServerProtocol import ServerProtocolFactory
|
||||||
|
|
||||||
from tests import mocks
|
from lbrynet.tests import mocks
|
||||||
from tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
|
from lbrynet.tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
|
||||||
|
|
||||||
FakeNode = mocks.Node
|
FakeNode = mocks.Node
|
||||||
FakeWallet = mocks.Wallet
|
FakeWallet = mocks.Wallet
|
|
@ -19,8 +19,8 @@ from lbrynet.lbry_file.client import EncryptedFileOptions
|
||||||
from lbrynet.file_manager import EncryptedFileCreator
|
from lbrynet.file_manager import EncryptedFileCreator
|
||||||
from lbrynet.file_manager import EncryptedFileManager
|
from lbrynet.file_manager import EncryptedFileManager
|
||||||
|
|
||||||
from tests import mocks
|
from lbrynet.tests import mocks
|
||||||
from tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
|
from lbrynet.tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
|
||||||
|
|
||||||
class TestReflector(unittest.TestCase):
|
class TestReflector(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
|
@ -19,7 +19,7 @@ from lbrynet.lbry_file.StreamDescriptor import get_sd_info
|
||||||
from lbrynet.core.PeerManager import PeerManager
|
from lbrynet.core.PeerManager import PeerManager
|
||||||
from lbrynet.core.RateLimiter import DummyRateLimiter, RateLimiter
|
from lbrynet.core.RateLimiter import DummyRateLimiter, RateLimiter
|
||||||
|
|
||||||
from tests import mocks
|
from lbrynet.tests import mocks
|
||||||
|
|
||||||
|
|
||||||
FakeNode = mocks.Node
|
FakeNode = mocks.Node
|
|
@ -8,7 +8,7 @@ from twisted.trial import unittest
|
||||||
from lbrynet.core import Peer
|
from lbrynet.core import Peer
|
||||||
from lbrynet.core.server import BlobRequestHandler
|
from lbrynet.core.server import BlobRequestHandler
|
||||||
from lbrynet.core.PaymentRateManager import NegotiatedPaymentRateManager, BasePaymentRateManager
|
from lbrynet.core.PaymentRateManager import NegotiatedPaymentRateManager, BasePaymentRateManager
|
||||||
from tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker, mock_conf_settings
|
from lbrynet.tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker, mock_conf_settings
|
||||||
|
|
||||||
|
|
||||||
class TestBlobRequestHandlerQueries(unittest.TestCase):
|
class TestBlobRequestHandlerQueries(unittest.TestCase):
|
|
@ -4,7 +4,7 @@ from twisted.internet import defer,task
|
||||||
from lbrynet.core.server.DHTHashAnnouncer import DHTHashAnnouncer,DHTHashSupplier
|
from lbrynet.core.server.DHTHashAnnouncer import DHTHashAnnouncer,DHTHashSupplier
|
||||||
from lbrynet.core.utils import random_string
|
from lbrynet.core.utils import random_string
|
||||||
from lbrynet.core import log_support, utils
|
from lbrynet.core import log_support, utils
|
||||||
from tests.util import random_lbry_hash
|
from lbrynet.tests.util import random_lbry_hash
|
||||||
|
|
||||||
class MocDHTNode(object):
|
class MocDHTNode(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
|
@ -5,7 +5,7 @@ import os
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from tests.util import random_lbry_hash
|
from lbrynet.tests.util import random_lbry_hash
|
||||||
from lbrynet.core.BlobManager import DiskBlobManager
|
from lbrynet.core.BlobManager import DiskBlobManager
|
||||||
from lbrynet.core.HashAnnouncer import DummyHashAnnouncer
|
from lbrynet.core.HashAnnouncer import DummyHashAnnouncer
|
||||||
from lbrynet.core.Peer import Peer
|
from lbrynet.core.Peer import Peer
|
|
@ -2,7 +2,7 @@ from lbrynet.blob import BlobFile
|
||||||
from lbrynet.core.Error import DownloadCanceledError, InvalidDataError
|
from lbrynet.core.Error import DownloadCanceledError, InvalidDataError
|
||||||
|
|
||||||
|
|
||||||
from tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir, random_lbry_hash
|
from lbrynet.tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir, random_lbry_hash
|
||||||
from twisted.trial import unittest
|
from twisted.trial import unittest
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
import os
|
import os
|
|
@ -5,7 +5,7 @@ import mock
|
||||||
from lbrynet.core.PaymentRateManager import NegotiatedPaymentRateManager, BasePaymentRateManager
|
from lbrynet.core.PaymentRateManager import NegotiatedPaymentRateManager, BasePaymentRateManager
|
||||||
from lbrynet.core.Strategy import BasicAvailabilityWeightedStrategy
|
from lbrynet.core.Strategy import BasicAvailabilityWeightedStrategy
|
||||||
from lbrynet.core.Offer import Offer
|
from lbrynet.core.Offer import Offer
|
||||||
from tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker, mock_conf_settings
|
from lbrynet.tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker, mock_conf_settings
|
||||||
|
|
||||||
MAX_NEGOTIATION_TURNS = 10
|
MAX_NEGOTIATION_TURNS = 10
|
||||||
random.seed(12345)
|
random.seed(12345)
|
|
@ -3,7 +3,7 @@ from twisted.internet import defer
|
||||||
from lbrynet.cryptstream import CryptBlob
|
from lbrynet.cryptstream import CryptBlob
|
||||||
from lbrynet import conf
|
from lbrynet import conf
|
||||||
|
|
||||||
from tests.mocks import mock_conf_settings
|
from lbrynet.tests.mocks import mock_conf_settings
|
||||||
|
|
||||||
from Crypto import Random
|
from Crypto import Random
|
||||||
from Crypto.Cipher import AES
|
from Crypto.Cipher import AES
|
|
@ -6,7 +6,7 @@ from lbrynet.lbry_file.EncryptedFileMetadataManager import DBEncryptedFileMetada
|
||||||
from lbrynet.core import utils
|
from lbrynet.core import utils
|
||||||
from lbrynet.cryptstream.CryptBlob import CryptBlobInfo
|
from lbrynet.cryptstream.CryptBlob import CryptBlobInfo
|
||||||
from lbrynet.core.Error import NoSuchStreamHash
|
from lbrynet.core.Error import NoSuchStreamHash
|
||||||
from tests.util import random_lbry_hash
|
from lbrynet.tests.util import random_lbry_hash
|
||||||
|
|
||||||
class DBEncryptedFileMetadataManagerTest(unittest.TestCase):
|
class DBEncryptedFileMetadataManagerTest(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
|
@ -12,8 +12,8 @@ from lbrynet.core import Session
|
||||||
from lbrynet.core.server import DHTHashAnnouncer
|
from lbrynet.core.server import DHTHashAnnouncer
|
||||||
from lbrynet.file_manager import EncryptedFileCreator
|
from lbrynet.file_manager import EncryptedFileCreator
|
||||||
from lbrynet.file_manager import EncryptedFileManager
|
from lbrynet.file_manager import EncryptedFileManager
|
||||||
from tests import mocks
|
from lbrynet.tests import mocks
|
||||||
from tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
|
from lbrynet.tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
|
||||||
|
|
||||||
MB = 2**20
|
MB = 2**20
|
||||||
|
|
|
@ -3,7 +3,7 @@ from twisted.trial import unittest
|
||||||
from lbrynet import conf
|
from lbrynet import conf
|
||||||
from lbrynet.file_manager.EncryptedFileDownloader import ManagedEncryptedFileDownloader
|
from lbrynet.file_manager.EncryptedFileDownloader import ManagedEncryptedFileDownloader
|
||||||
from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager
|
from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager
|
||||||
from tests.util import random_lbry_hash
|
from lbrynet.tests.util import random_lbry_hash
|
||||||
|
|
||||||
class TestEncryptedFileManager(unittest.TestCase):
|
class TestEncryptedFileManager(unittest.TestCase):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import mock
|
import mock
|
||||||
from twisted.trial import unittest
|
from twisted.trial import unittest
|
||||||
|
|
||||||
from tests.mocks import mock_conf_settings
|
from lbrynet.tests.mocks import mock_conf_settings
|
||||||
from lbrynet.daemon.auth import server
|
from lbrynet.daemon.auth import server
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,11 @@ from lbrynet.core import Session, PaymentRateManager, Wallet
|
||||||
from lbrynet.daemon.Daemon import Daemon as LBRYDaemon
|
from lbrynet.daemon.Daemon import Daemon as LBRYDaemon
|
||||||
from lbrynet.daemon import ExchangeRateManager
|
from lbrynet.daemon import ExchangeRateManager
|
||||||
|
|
||||||
from tests import util
|
from lbrynet.tests import util
|
||||||
from tests.mocks import mock_conf_settings, FakeNetwork
|
from lbrynet.tests.mocks import mock_conf_settings, FakeNetwork
|
||||||
from tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker
|
from lbrynet.tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker
|
||||||
from tests.mocks import ExchangeRateManager as DummyExchangeRateManager
|
from lbrynet.tests.mocks import ExchangeRateManager as DummyExchangeRateManager
|
||||||
from tests.mocks import BTCLBCFeed, USDBTCFeed
|
from lbrynet.tests.mocks import BTCLBCFeed, USDBTCFeed
|
||||||
|
|
||||||
def get_test_daemon(data_rate=None, generous=True, with_fee=False):
|
def get_test_daemon(data_rate=None, generous=True, with_fee=False):
|
||||||
if data_rate is None:
|
if data_rate is None:
|
|
@ -16,10 +16,10 @@ from lbrynet.file_manager.EncryptedFileStatusReport import EncryptedFileStatusRe
|
||||||
from lbrynet.file_manager.EncryptedFileDownloader import ManagedEncryptedFileDownloader, ManagedEncryptedFileDownloaderFactory
|
from lbrynet.file_manager.EncryptedFileDownloader import ManagedEncryptedFileDownloader, ManagedEncryptedFileDownloaderFactory
|
||||||
from lbrynet.daemon.ExchangeRateManager import ExchangeRateManager
|
from lbrynet.daemon.ExchangeRateManager import ExchangeRateManager
|
||||||
|
|
||||||
from tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker
|
from lbrynet.tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker
|
||||||
from tests.mocks import ExchangeRateManager as DummyExchangeRateManager
|
from lbrynet.tests.mocks import ExchangeRateManager as DummyExchangeRateManager
|
||||||
from tests.mocks import BTCLBCFeed, USDBTCFeed
|
from lbrynet.tests.mocks import BTCLBCFeed, USDBTCFeed
|
||||||
from tests.mocks import mock_conf_settings
|
from lbrynet.tests.mocks import mock_conf_settings
|
||||||
|
|
||||||
class MocDownloader(object):
|
class MocDownloader(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
|
@ -3,9 +3,9 @@ from lbrynet.daemon import ExchangeRateManager
|
||||||
from lbrynet.core.Error import InvalidExchangeRateResponse
|
from lbrynet.core.Error import InvalidExchangeRateResponse
|
||||||
from twisted.trial import unittest
|
from twisted.trial import unittest
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from tests import util
|
from lbrynet.tests import util
|
||||||
from tests.mocks import ExchangeRateManager as DummyExchangeRateManager
|
from lbrynet.tests.mocks import ExchangeRateManager as DummyExchangeRateManager
|
||||||
from tests.mocks import BTCLBCFeed, USDBTCFeed
|
from lbrynet.tests.mocks import BTCLBCFeed, USDBTCFeed
|
||||||
|
|
||||||
|
|
||||||
class FeeFormatTest(unittest.TestCase):
|
class FeeFormatTest(unittest.TestCase):
|
2
setup.py
2
setup.py
|
@ -62,7 +62,7 @@ setup(
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
keywords="lbry protocol media",
|
keywords="lbry protocol media",
|
||||||
license='MIT',
|
license='MIT',
|
||||||
packages=find_packages(base_dir, exclude=['tests']),
|
packages=find_packages(base_dir),
|
||||||
install_requires=requires,
|
install_requires=requires,
|
||||||
entry_points={'console_scripts': console_scripts},
|
entry_points={'console_scripts': console_scripts},
|
||||||
package_data={
|
package_data={
|
||||||
|
|
Loading…
Reference in a new issue