Skip to content

Commit

Permalink
Merge pull request #161 from lightning-power-users/fix-tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
PierreRochard authored Feb 4, 2019
2 parents 26fd04a + 881c490 commit 1135e05
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions node_launcher/gui/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def __init__(self):

def check_version(self):
latest_version = LauncherSoftware().get_latest_release_version()
if latest_version is None:
return
latest_major, latest_minor, latest_bugfix = latest_version.split('.')
major, minor, bugfix = NODE_LAUNCHER_RELEASE.split('.')

Expand Down
3 changes: 1 addition & 2 deletions node_launcher/gui/network_buttons/lnd_wallet_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from PySide2 import QtWidgets
from PySide2.QtCore import QThreadPool
from PySide2.QtWidgets import QInputDialog, QLineEdit, QErrorMessage, QWidget
from PySide2.QtWidgets import QInputDialog, QLineEdit, QErrorMessage
# noinspection PyProtectedMember
from grpc._channel import _Rendezvous

Expand Down Expand Up @@ -108,7 +108,6 @@ def handle_lnd_poll(self, details: str):
pass
else:
self.error_message.showMessage(details)
# QErrorMessage.showMessage(self.error_message, details)
self.set_open_state()

def set_unlock_state(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def lnd_wallet_layout() -> LndWalletLayout:
node_set = MagicMock()
node_set.network = 'mainnet'
lnd_wallet_layout = LndWalletLayout(node_set)
lnd_wallet_layout.error_message = MagicMock()
return lnd_wallet_layout


Expand All @@ -32,7 +33,6 @@ def test_handle_lnd_poll_error_message(self,
lnd_wallet_layout: LndWalletLayout,
qtbot: QTest):
lnd_wallet_layout.handle_lnd_poll('unknown gRPC error detail')
# error_message_patch.showMessage.assert_called()
lnd_wallet_layout.error_message.showMessage.assert_called()

def test_unlock_wallet(self,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_gui/test_seed_dialog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import time
from unittest.mock import MagicMock

import pytest
from PySide2.QtCore import Qt
from PySide2.QtTest import QTest

Expand All @@ -10,6 +11,7 @@


class TestSeedDialog(object):
@pytest.mark.slow
def test_show(self, qtbot: QTest, main_widget: MainWidget):
main_widget.testnet_network_widget.node_set.lnd_client.generate_seed = MagicMock(return_value=GenSeedResponse(cipher_seed_mnemonic=['test', 'seed']))
qtbot.mouseClick(main_widget.testnet_network_widget.lnd_wallet_layout.create_wallet_button,
Expand Down
5 changes: 4 additions & 1 deletion tests/test_node_software/test_launcher_software.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ def launcher_software() -> LauncherSoftware:


class TestLauncherSoftware(object):
@pytest.mark.slow
def test_get_latest_release_version(self, launcher_software: LauncherSoftware):
assert launcher_software.get_latest_release_version() == NODE_LAUNCHER_RELEASE
latest = launcher_software.get_latest_release_version()
if latest is not None:
assert latest == NODE_LAUNCHER_RELEASE

0 comments on commit 1135e05

Please sign in to comment.