diff --git a/tests/mocks.py b/tests/mocks.py index 8e3ed945a..9dea430d7 100644 --- a/tests/mocks.py +++ b/tests/mocks.py @@ -30,6 +30,16 @@ class Node(object): pass +class FakeNetwork(object): + @staticmethod + def get_local_height(): + return 1 + + @staticmethod + def get_server_height(): + return 1 + + class Wallet(object): def __init__(self): self.private_key = RSA.generate(1024) diff --git a/tests/unit/lbrynet_daemon/test_Daemon.py b/tests/unit/lbrynet_daemon/test_Daemon.py index 4dc338f94..59fa120bf 100644 --- a/tests/unit/lbrynet_daemon/test_Daemon.py +++ b/tests/unit/lbrynet_daemon/test_Daemon.py @@ -10,7 +10,7 @@ from lbrynet.core import Session, PaymentRateManager, Wallet from lbrynet.lbrynet_daemon.Daemon import Daemon as LBRYDaemon from lbrynet.lbrynet_daemon import ExchangeRateManager from lbrynet import conf -from tests.mocks import mock_conf_settings +from tests.mocks import mock_conf_settings, FakeNetwork class MiscTests(unittest.TestCase): @@ -117,11 +117,15 @@ class TestCostEst(unittest.TestCase): class TestJsonRpc(unittest.TestCase): def setUp(self): + def noop(): + return None + mock_conf_settings(self) util.resetTime(self) self.test_daemon = get_test_daemon() self.test_daemon.session.wallet = Wallet.LBRYumWallet(storage=Wallet.InMemoryStorage()) - # self.test_daemon.session.wallet = FakeWallet() + self.test_daemon.session.wallet.network = FakeNetwork() + self.test_daemon.session.wallet.get_best_blockhash = noop def test_status(self): d = defer.maybeDeferred(self.test_daemon.jsonrpc_status)