Beispiel #1
0
def fail_backend():
    mock_backend = MockObject()

    def fail_request():
        raise ConnectionError

    mock_backend.accounts = lambda *_: fail_request()
    monero.backends.jsonrpc.JSONRPCWallet.__new__ = lambda *_, **__: mock_backend
Beispiel #2
0
def succeed_backend():
    mock_backend = MockObject()
    mock_backend.accounts = lambda *_: [monero.account.Account(mock_backend, 0)]
    mock_backend.addresses = lambda **_: [TEST_ADDRESS]
    mock_backend.new_address = lambda **_: (TEST_ADDRESS, 1)
    monero.backends.jsonrpc.JSONRPCWallet.__new__ = lambda *_, **__: mock_backend