Exemplo n.º 1
0
def launch_widget():
    bitcoin_mainnet_conf = BitcoinConfiguration()
    bitcoin_testnet_conf = BitcoinConfiguration()
    command_generator = CommandGenerator(
        testnet_conf=Configuration('testnet', bitcoin_testnet_conf),
        mainnet_conf=Configuration('mainnet', bitcoin_mainnet_conf))
    node_launcher = NodeLauncher(command_generator)
    node_launcher.testnet_bitcoin_qt_node = MagicMock(return_value=None)
    node_launcher.mainnet_bitcoin_qt_node = MagicMock(return_value=None)
    node_launcher.testnet_lnd_node = MagicMock(return_value=None)
    node_launcher.mainnet_lnd_node = MagicMock(return_value=None)
    launch_widget = LaunchWidget(node_launcher)
    return launch_widget
Exemplo n.º 2
0
 def test_mainnet_lnd_node(self, mocked_node_launcher: NodeLauncher):
     mocked_node_launcher.mainnet_lnd_node()
     mocked_node_launcher.command_generator.mainnet_lnd.assert_called_once()
Exemplo n.º 3
0
def mocked_node_launcher(mock_command_generator):
    launch_fn = MagicMock()
    launch_terminal_fn = MagicMock()
    mocked_node_launcher = NodeLauncher(mock_command_generator, launch_fn,
                                        launch_terminal_fn)
    return mocked_node_launcher
Exemplo n.º 4
0
 def test_testnet_bitcoin_qt_node(self, mocked_node_launcher: NodeLauncher):
     mocked_node_launcher.testnet_bitcoin_qt_node()
     mocked_node_launcher.command_generator.testnet_bitcoin_qt.assert_called_once(
     )
Exemplo n.º 5
0
import sys

from PySide2 import QtWidgets

from node_launcher.command_generator import CommandGenerator
from node_launcher.configuration import Configuration
from node_launcher.configuration.bitcoin_configuration import \
    BitcoinConfiguration
from node_launcher.gui.launch_widget import LaunchWidget
from node_launcher.node_launcher import NodeLauncher

if __name__ == "__main__":
    app = QtWidgets.QApplication([])

    bitcoin_mainnet_conf = BitcoinConfiguration()
    bitcoin_testnet_conf = BitcoinConfiguration()
    command_generator = CommandGenerator(
        testnet_conf=Configuration('testnet', bitcoin_testnet_conf),
        mainnet_conf=Configuration('mainnet', bitcoin_mainnet_conf))
    node_launcher = NodeLauncher(command_generator)
    widget = LaunchWidget(node_launcher)

    widget.show()

    sys.exit(app.exec_())