moved tests into the lbrynet package

This commit is contained in:
Akinwale Ariwodola 2017-09-28 18:21:26 +01:00
parent 42a141e7b7
commit 2abe85ba25
53 changed files with 32 additions and 31 deletions

View file

@ -39,7 +39,7 @@ script:
- pip install cython
- pip install mock pylint unqlite
- pylint lbrynet
- PYTHONPATH=. trial tests
- python -m unittest discover tests/integration
- PYTHONPATH=. trial lbrynet.tests
- python -m unittest discover lbrynet/tests/integration
- rvm install ruby-2.3.1
- rvm use 2.3.1 && gem install danger --version '~> 4.0' && danger

View file

@ -27,6 +27,7 @@ at anytime.
### Changed
* Announcing by head blob is turned on by default
* Updated reflector server dns
* Moved tests into the lbrynet package.
### Added
* Added WAL pragma to sqlite3

View file

@ -32,8 +32,8 @@ from lbrynet.core.RateLimiter import DummyRateLimiter, RateLimiter
from lbrynet.core.server.BlobRequestHandler import BlobRequestHandlerFactory
from lbrynet.core.server.ServerProtocol import ServerProtocolFactory
from tests import mocks
from tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
from lbrynet.tests import mocks
from lbrynet.tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
FakeNode = mocks.Node
FakeWallet = mocks.Wallet

View file

@ -19,8 +19,8 @@ from lbrynet.lbry_file.client import EncryptedFileOptions
from lbrynet.file_manager import EncryptedFileCreator
from lbrynet.file_manager import EncryptedFileManager
from tests import mocks
from tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
from lbrynet.tests import mocks
from lbrynet.tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
class TestReflector(unittest.TestCase):
def setUp(self):

View file

@ -19,7 +19,7 @@ from lbrynet.lbry_file.StreamDescriptor import get_sd_info
from lbrynet.core.PeerManager import PeerManager
from lbrynet.core.RateLimiter import DummyRateLimiter, RateLimiter
from tests import mocks
from lbrynet.tests import mocks
FakeNode = mocks.Node

View file

@ -8,7 +8,7 @@ from twisted.trial import unittest
from lbrynet.core import Peer
from lbrynet.core.server import BlobRequestHandler
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):

View file

@ -4,7 +4,7 @@ from twisted.internet import defer,task
from lbrynet.core.server.DHTHashAnnouncer import DHTHashAnnouncer,DHTHashSupplier
from lbrynet.core.utils import random_string
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):
def __init__(self):

View file

@ -5,7 +5,7 @@ import os
import random
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.HashAnnouncer import DummyHashAnnouncer
from lbrynet.core.Peer import Peer

View file

@ -2,7 +2,7 @@ from lbrynet.blob import BlobFile
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.internet import defer
import os

View file

@ -5,7 +5,7 @@ import mock
from lbrynet.core.PaymentRateManager import NegotiatedPaymentRateManager, BasePaymentRateManager
from lbrynet.core.Strategy import BasicAvailabilityWeightedStrategy
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
random.seed(12345)

View file

@ -3,7 +3,7 @@ from twisted.internet import defer
from lbrynet.cryptstream import CryptBlob
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.Cipher import AES

View file

@ -6,7 +6,7 @@ from lbrynet.lbry_file.EncryptedFileMetadataManager import DBEncryptedFileMetada
from lbrynet.core import utils
from lbrynet.cryptstream.CryptBlob import CryptBlobInfo
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):
def setUp(self):

View file

@ -12,8 +12,8 @@ from lbrynet.core import Session
from lbrynet.core.server import DHTHashAnnouncer
from lbrynet.file_manager import EncryptedFileCreator
from lbrynet.file_manager import EncryptedFileManager
from tests import mocks
from tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
from lbrynet.tests import mocks
from lbrynet.tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
MB = 2**20

View file

@ -3,7 +3,7 @@ from twisted.trial import unittest
from lbrynet import conf
from lbrynet.file_manager.EncryptedFileDownloader import ManagedEncryptedFileDownloader
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):

View file

@ -1,7 +1,7 @@
import mock
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

View file

@ -10,11 +10,11 @@ from lbrynet.core import Session, PaymentRateManager, Wallet
from lbrynet.daemon.Daemon import Daemon as LBRYDaemon
from lbrynet.daemon import ExchangeRateManager
from tests import util
from tests.mocks import mock_conf_settings, FakeNetwork
from tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker
from tests.mocks import ExchangeRateManager as DummyExchangeRateManager
from tests.mocks import BTCLBCFeed, USDBTCFeed
from lbrynet.tests import util
from lbrynet.tests.mocks import mock_conf_settings, FakeNetwork
from lbrynet.tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker
from lbrynet.tests.mocks import ExchangeRateManager as DummyExchangeRateManager
from lbrynet.tests.mocks import BTCLBCFeed, USDBTCFeed
def get_test_daemon(data_rate=None, generous=True, with_fee=False):
if data_rate is None:

View file

@ -16,10 +16,10 @@ from lbrynet.file_manager.EncryptedFileStatusReport import EncryptedFileStatusRe
from lbrynet.file_manager.EncryptedFileDownloader import ManagedEncryptedFileDownloader, ManagedEncryptedFileDownloaderFactory
from lbrynet.daemon.ExchangeRateManager import ExchangeRateManager
from tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker
from tests.mocks import ExchangeRateManager as DummyExchangeRateManager
from tests.mocks import BTCLBCFeed, USDBTCFeed
from tests.mocks import mock_conf_settings
from lbrynet.tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker
from lbrynet.tests.mocks import ExchangeRateManager as DummyExchangeRateManager
from lbrynet.tests.mocks import BTCLBCFeed, USDBTCFeed
from lbrynet.tests.mocks import mock_conf_settings
class MocDownloader(object):
def __init__(self):

View file

@ -3,9 +3,9 @@ from lbrynet.daemon import ExchangeRateManager
from lbrynet.core.Error import InvalidExchangeRateResponse
from twisted.trial import unittest
from twisted.internet import defer
from tests import util
from tests.mocks import ExchangeRateManager as DummyExchangeRateManager
from tests.mocks import BTCLBCFeed, USDBTCFeed
from lbrynet.tests import util
from lbrynet.tests.mocks import ExchangeRateManager as DummyExchangeRateManager
from lbrynet.tests.mocks import BTCLBCFeed, USDBTCFeed
class FeeFormatTest(unittest.TestCase):

View file

@ -62,7 +62,7 @@ setup(
long_description=long_description,
keywords="lbry protocol media",
license='MIT',
packages=find_packages(base_dir, exclude=['tests']),
packages=find_packages(base_dir),
install_requires=requires,
entry_points={'console_scripts': console_scripts},
package_data={