From 5597d45aed1efa4fdd605a8d7ed20df068671153 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Wed, 25 Jul 2018 01:15:51 -0400 Subject: [PATCH] got integration tests to work again with rebased branch --- lbrynet/daemon/ComponentManager.py | 4 +--- lbrynet/daemon/__init__.py | 1 - lbrynet/daemon/auth/server.py | 6 +++--- tests/integration/wallet/test_commands.py | 6 +++--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lbrynet/daemon/ComponentManager.py b/lbrynet/daemon/ComponentManager.py index b33d6887b..4f2969517 100644 --- a/lbrynet/daemon/ComponentManager.py +++ b/lbrynet/daemon/ComponentManager.py @@ -20,7 +20,7 @@ class RequiredConditionType(type): return klass -class RequiredCondition(object): +class RequiredCondition(metaclass=RequiredConditionType): name = "" component = "" message = "" @@ -29,8 +29,6 @@ class RequiredCondition(object): def evaluate(component): raise NotImplementedError() - __metaclass__ = RequiredConditionType - class ComponentManager(object): default_component_classes = {} diff --git a/lbrynet/daemon/__init__.py b/lbrynet/daemon/__init__.py index 77d34b059..7d3f2be07 100644 --- a/lbrynet/daemon/__init__.py +++ b/lbrynet/daemon/__init__.py @@ -1,2 +1 @@ -from . import custom_logger from . import Components # register Component classes diff --git a/lbrynet/daemon/auth/server.py b/lbrynet/daemon/auth/server.py index 18f228366..ee8ebaa6a 100644 --- a/lbrynet/daemon/auth/server.py +++ b/lbrynet/daemon/auth/server.py @@ -141,7 +141,7 @@ class AuthorizedBase(metaclass=JSONRPCServerType): @staticmethod def requires(*components, **conditions): - if conditions and ["conditions"] != conditions.keys(): + if conditions and ["conditions"] != list(conditions.keys()): raise SyntaxError("invalid conditions argument") condition_names = conditions.get("conditions", []) @@ -202,8 +202,8 @@ class AuthJSONRPCServer(AuthorizedBase): skip_components=to_skip or [], reactor=reactor ) - self.looping_call_manager = LoopingCallManager({n: lc for n, (lc, t) in (looping_calls or {}).iteritems()}) - self._looping_call_times = {n: t for n, (lc, t) in (looping_calls or {}).iteritems()} + self.looping_call_manager = LoopingCallManager({n: lc for n, (lc, t) in (looping_calls or {}).items()}) + self._looping_call_times = {n: t for n, (lc, t) in (looping_calls or {}).items()} self._use_authentication = use_authentication or conf.settings['use_auth_http'] self._component_setup_deferred = None self.announced_startup = False diff --git a/tests/integration/wallet/test_commands.py b/tests/integration/wallet/test_commands.py index 86b30f676..842ba0307 100644 --- a/tests/integration/wallet/test_commands.py +++ b/tests/integration/wallet/test_commands.py @@ -15,7 +15,7 @@ lbryschema.BLOCKCHAIN_NAME = 'lbrycrd_regtest' from lbrynet import conf as lbry_conf from lbrynet.daemon.Daemon import Daemon from lbrynet.wallet.manager import LbryWalletManager -from lbrynet.daemon.Components import WalletComponent, FileManager, SessionComponent, DatabaseComponent +from lbrynet.daemon.Components import WalletComponent, FileManagerComponent, SessionComponent, DatabaseComponent from lbrynet.daemon.ComponentManager import ComponentManager from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager @@ -106,7 +106,7 @@ class CommandTestCase(IntegrationTestCase): analytics_manager = FakeAnalytics() self.daemon = Daemon(analytics_manager, ComponentManager(analytics_manager, skip_components=[ - 'wallet', 'database', 'session', 'fileManager' + 'wallet', 'database', 'session', 'file_manager' ])) wallet_component = WalletComponent(self.daemon.component_manager) @@ -130,7 +130,7 @@ class CommandTestCase(IntegrationTestCase): self.daemon.session.blob_manager.storage = self.daemon.storage self.daemon.component_manager.components.add(session_component) - file_manager = FileManager(self.daemon.component_manager) + file_manager = FileManagerComponent(self.daemon.component_manager) file_manager.file_manager = EncryptedFileManager(session_component.session, True) file_manager._running = True self.daemon.file_manager = file_manager.file_manager