From 1ae11370051fa23c5a763b3146b24cf20d018c0b Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Mon, 21 Jan 2019 23:58:43 -0500 Subject: [PATCH] fixing integration tests --- .travis.yml | 3 +-- tests/integration/wallet/test_commands.py | 33 ++++++++++------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index d37cb8e17..ade9f64a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,8 +25,7 @@ jobs: - pip install -e .[test] script: - HOME=/tmp coverage run -p --source=lbrynet -m twisted.trial --reactor=asyncio tests.unit.core tests.unit.cryptstream tests.unit.database tests.unit.dht tests.unit.lbryfilemanager tests.unit.lbrynet_daemon tests.unit.schema tests.unit.wallet tests.unit.components tests.unit.test_conf - - HOME=/tmp coverage run -p --source=lbrynet -m twisted.trial --reactor=asyncio tests.unit.test_cli - #- HOME=/tmp coverage run -p --source=lbrynet -m twisted.trial --reactor=asyncio tests.unit.analytics + #- HOME=/tmp coverage run -p --source=lbrynet -m twisted.trial --reactor=asyncio tests.unit.test_cli tests.unit.analytics after_success: - coverage combine - bash <(curl -s https://codecov.io/bash) diff --git a/tests/integration/wallet/test_commands.py b/tests/integration/wallet/test_commands.py index f4e923eae..622434bdb 100644 --- a/tests/integration/wallet/test_commands.py +++ b/tests/integration/wallet/test_commands.py @@ -16,7 +16,7 @@ from torba.testcase import IntegrationTestCase import lbrynet.schema lbrynet.schema.BLOCKCHAIN_NAME = 'lbrycrd_regtest' -from lbrynet import conf as lbry_conf +from lbrynet.conf import Config from lbrynet.extras.daemon.Daemon import Daemon, jsonrpc_dumps_pretty from lbrynet.extras.wallet import LbryWalletManager from lbrynet.extras.daemon.Components import WalletComponent @@ -63,19 +63,16 @@ class CommandTestCase(IntegrationTestCase): logging.getLogger('lbrynet.p2p').setLevel(self.VERBOSITY) logging.getLogger('lbrynet.daemon').setLevel(self.VERBOSITY) - lbry_conf.settings = None - lbry_conf.initialize_settings( - load_conf_file=False, - data_dir=self.wallet_node.data_path, - wallet_dir=self.wallet_node.data_path, - download_dir=self.wallet_node.data_path - ) - lbry_conf.settings['use_upnp'] = False - lbry_conf.settings['reflect_uploads'] = False - lbry_conf.settings['blockchain_name'] = 'lbrycrd_regtest' - lbry_conf.settings['lbryum_servers'] = [('localhost', 50001)] - lbry_conf.settings['known_dht_nodes'] = [] - lbry_conf.settings.node_id = None + conf = Config() + conf.data_dir = self.wallet_node.data_path + conf.wallet_dir = self.wallet_node.data_path + conf.download_dir = self.wallet_node.data_path + conf.share_usage_data = False + conf.use_upnp = False + conf.reflect_uploads = False + conf.blockchain_name = 'lbrycrd_regtest' + conf.lbryum_servers = [('localhost', 50001)] + conf.known_dht_nodes = [] await self.account.ensure_address_gap() address = (await self.account.receiving.get_addresses(limit=1, only_usable=True))[0] @@ -89,14 +86,12 @@ class CommandTestCase(IntegrationTestCase): self.wallet_component._running = True return self.wallet_component - skip = [ + conf.components_to_skip = [ DHT_COMPONENT, UPNP_COMPONENT, HASH_ANNOUNCER_COMPONENT, PEER_PROTOCOL_SERVER_COMPONENT, REFLECTOR_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT ] - analytics_manager = FakeAnalytics() - self.daemon = Daemon(analytics_manager, ComponentManager( - analytics_manager=analytics_manager, - skip_components=skip, wallet=wallet_maker + self.daemon = Daemon(conf, ComponentManager( + conf, skip_components=conf.components_to_skip, wallet=wallet_maker )) await self.daemon.setup() self.daemon.wallet_manager = self.wallet_component.wallet_manager