Skip to content

Commit

Permalink
Try to fix core dump in travis
Browse files Browse the repository at this point in the history
Ref #282
  • Loading branch information
algorys committed Mar 23, 2018
1 parent 03b500a commit 7f0683e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions alignak_app/qobjects/events/spy_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@ class SpyQListWidget(QListWidget):
"""

item_dropped = pyqtSignal(EventItem, name="remove_item")
host_spied = pyqtSignal(str, name="host_spied")

def __init__(self):
super(SpyQListWidget, self).__init__()
self.setIconSize(QSize(16, 16))
# Fields
self.initialized = False
self.spied_hosts = []
self.host_spied.connect(self.add_spy_host)

def add_spy_host(self, host_id):
"""
Expand Down
2 changes: 1 addition & 1 deletion alignak_app/qobjects/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def spy_host(self):

if self.line_search.text() in self.hostnames_list:
host = data_manager.get_item('host', 'name', self.line_search.text())
self.spy_widget.spy_list_widget.host_spied.emit(host.item_id)
self.spy_widget.spy_list_widget.add_spy_host(host.item_id)
self.spy_button.setEnabled(False)

self.spy_button.setIcon(
Expand Down
5 changes: 4 additions & 1 deletion test/test_panel_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from alignak_app.items.service import Service

from alignak_app.qobjects.panel import PanelQWidget
from alignak_app.qobjects.events.events import init_event_widget


class TestPanelQWidget(unittest2.TestCase):
Expand Down Expand Up @@ -144,6 +145,8 @@ def test_create_widget(self):
def test_spy_host(self):
"""Panel Add Spy Host"""

init_event_widget()

under_test = PanelQWidget()
under_test.initialize()

Expand Down Expand Up @@ -178,4 +181,4 @@ def test_update_panels(self):
under_test.tab_widget.widget(1).update_problems_data()

# There are only 9 services in CRITICAL condition
self.assertEqual('Problems (19)', under_test.tab_widget.tabText(1))
self.assertEqual('Problems (19)', under_test.tab_widget.tabText(1))

0 comments on commit 7f0683e

Please sign in to comment.