fixed import paths as a result of moving the tests

This commit is contained in:
Lex Berezhny 2018-07-06 16:16:58 -04:00 committed by Jack Robison
parent edfc2c6124
commit 03d2d0e237
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
15 changed files with 29 additions and 25 deletions

View file

@ -7,7 +7,7 @@ from lbrynet.daemon.Components import HASH_ANNOUNCER_COMPONENT, REFLECTOR_COMPON
from lbrynet.daemon.Components import PEER_PROTOCOL_SERVER_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT
from lbrynet.daemon.Components import RATE_LIMITER_COMPONENT, HEADERS_COMPONENT, PAYMENT_RATE_COMPONENT
from lbrynet.daemon import Components
from lbrynet.tests import mocks
from tests import mocks
class TestComponentManager(unittest.TestCase):

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 lbrynet.tests.mocks\
from tests.mocks\
import BlobAvailabilityTracker as DummyBlobAvailabilityTracker, mock_conf_settings

View file

@ -6,7 +6,7 @@ import string
from twisted.trial import unittest
from twisted.internet import defer, threads
from lbrynet.tests.util import random_lbry_hash
from tests.util import random_lbry_hash
from lbrynet.core.BlobManager import DiskBlobManager
from lbrynet.database.storage import SQLiteStorage
from lbrynet.core.Peer import Peer

View file

@ -1,11 +1,11 @@
from lbrynet.blob import BlobFile
from lbrynet.core.Error import DownloadCanceledError, InvalidDataError
from lbrynet.tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir, random_lbry_hash
from 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
class BlobFileTest(unittest.TestCase):
def setUp(self):
self.db_dir, self.blob_dir = mk_db_and_blob_dir()

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 lbrynet.tests.mocks\
from tests.mocks\
import BlobAvailabilityTracker as DummyBlobAvailabilityTracker, mock_conf_settings
MAX_NEGOTIATION_TURNS = 10

View file

@ -8,7 +8,7 @@ from collections import defaultdict
from twisted.trial import unittest
from twisted.internet import threads, defer
from lbrynet.database.storage import SQLiteStorage
from lbrynet.tests.mocks import FakeNetwork
from tests.mocks import FakeNetwork
from lbrynet.core.Error import InsufficientFundsError
#from lbrynet.core.Wallet import LBRYumWallet, ReservedPoints
#from lbryum.commands import Commands

View file

@ -7,7 +7,7 @@ from twisted.internet import defer
from twisted import trial
from lbrynet.core import log_support
from lbrynet.tests.util import is_android
from tests.util import is_android
class TestLogger(trial.unittest.TestCase):

View file

@ -3,7 +3,7 @@ from twisted.internet import defer
from lbrynet.cryptstream import CryptBlob
from lbrynet.blob.blob_file import MAX_BLOB_SIZE
from lbrynet.tests.mocks import mock_conf_settings
from tests.mocks import mock_conf_settings
from cryptography.hazmat.primitives.ciphers.algorithms import AES
import random

View file

@ -8,7 +8,7 @@ from twisted.trial import unittest
from lbrynet import conf
from lbrynet.database.storage import SQLiteStorage, open_file_for_writing
from lbrynet.file_manager.EncryptedFileDownloader import ManagedEncryptedFileDownloader
from lbrynet.tests.util import random_lbry_hash
from tests.util import random_lbry_hash
log = logging.getLogger()

View file

@ -3,7 +3,7 @@ from twisted.internet import defer, task
from lbrynet import conf
from lbrynet.core import utils
from lbrynet.dht.hashannouncer import DHTHashAnnouncer
from lbrynet.tests.util import random_lbry_hash
from tests.util import random_lbry_hash
class MocDHTNode(object):

View file

@ -12,8 +12,8 @@ from lbrynet.core.PaymentRateManager import OnlyFreePaymentsManager
from lbrynet.database.storage import SQLiteStorage
from lbrynet.file_manager import EncryptedFileCreator
from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager
from lbrynet.tests import mocks
from lbrynet.tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
from tests import mocks
from tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir
FakeNode = mocks.Node
@ -72,8 +72,8 @@ class CreateEncryptedFileTest(unittest.TestCase):
def test_can_create_file(self):
expected_stream_hash = "41e6b247d923d191b154fb6f1b8529d6ddd6a73d65c35" \
"7b1acb742dd83151fb66393a7709e9f346260a4f4db6de10c25"
expected_sd_hash = "db043b44384c149126685990f6bb6563aa565ae331303d522" \
"c8728fe0534dd06fbcacae92b0891787ad9b68ffc8d20c1"
expected_sd_hash = "40c485432daec586c1a2d247e6c08d137640a5af6e81f3f652" \
"3e62e81a2e8945b0db7c94f1852e70e371d917b994352c"
filename = 'test.file'
lbry_file = yield self.create_file(filename)
sd_hash = yield self.storage.get_sd_blob_hash_for_stream(lbry_file.stream_hash)

View file

@ -1,9 +1,10 @@
import mock
from twisted.trial import unittest
from lbrynet import conf
from lbrynet.tests.mocks import mock_conf_settings
from lbrynet.daemon.auth import server
from tests.mocks import mock_conf_settings
class AuthJSONRPCServerTest(unittest.TestCase):
# TODO: move to using a base class for tests

View file

@ -22,11 +22,11 @@ from lbrynet.wallet.manager import LbryWalletManager
from torba.wallet import Wallet
from lbrynet.core.PaymentRateManager import OnlyFreePaymentsManager
from lbrynet.tests import util
from lbrynet.tests.mocks import mock_conf_settings, FakeNetwork, FakeFileManager
from lbrynet.tests.mocks import ExchangeRateManager as DummyExchangeRateManager
from lbrynet.tests.mocks import BTCLBCFeed, USDBTCFeed
from lbrynet.tests.util import is_android
from tests import util
from tests.mocks import mock_conf_settings, FakeNetwork, FakeFileManager
from tests.mocks import ExchangeRateManager as DummyExchangeRateManager
from tests.mocks import BTCLBCFeed, USDBTCFeed
from tests.util import is_android
import logging

View file

@ -5,7 +5,7 @@ from twisted.internet import defer, task
from lbrynet.wallet.manager import LbryWalletManager
from lbrynet.core import PaymentRateManager, Wallet
from lbrynet.core import PaymentRateManager
from lbrynet.core.Error import DownloadDataTimeout, DownloadSDTimeout
from lbrynet.daemon import Downloader
from lbrynet.core.StreamDescriptor import StreamDescriptorIdentifier
@ -17,6 +17,7 @@ from lbrynet.file_manager.EncryptedFileStatusReport import EncryptedFileStatusRe
from lbrynet.file_manager.EncryptedFileDownloader import ManagedEncryptedFileDownloader
from lbrynet.daemon.ExchangeRateManager import ExchangeRateManager
from lbrynet.tests.mocks import ExchangeRateManager as DummyExchangeRateManager
from lbrynet.tests.mocks import mock_conf_settings
@ -65,8 +66,10 @@ def moc_pay_key_fee(self, key_fee, name):
class GetStreamTests(unittest.TestCase):
def init_getstream_with_mocs(self):
mock_conf_settings(self)
sd_identifier = mock.Mock(spec=StreamDescriptorIdentifier)
wallet = mock.Mock(spec=LbryWalletmanager)
prm = mock.Mock(spec=PaymentRateManager.NegotiatedPaymentRateManager)

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 lbrynet.tests import util
from lbrynet.tests.mocks import ExchangeRateManager as DummyExchangeRateManager
from lbrynet.tests.mocks import BTCLBCFeed, USDBTCFeed
from tests import util
from tests.mocks import ExchangeRateManager as DummyExchangeRateManager
from tests.mocks import BTCLBCFeed, USDBTCFeed
class FeeFormatTest(unittest.TestCase):