Skip to content

Commit

Permalink
Referential changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Insoleet committed Apr 11, 2016
1 parent 3a81aee commit 6324007
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sakia/gui/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, app, account, homescreen, community_view, widget, ui,

self.combo_referential = combo_referential
self.combo_referential.setEnabled(False)
self.combo_referential.currentIndexChanged[str].connect(self.referential_changed)
self.combo_referential.currentIndexChanged[int].connect(self.referential_changed)

self.homescreen = homescreen

Expand Down Expand Up @@ -190,7 +190,7 @@ def display_error(self, error):
error,
QMessageBox.Ok)

@pyqtSlot(str)
@pyqtSlot(int)
def referential_changed(self, index):
if self.account:
self.account.set_display_referential(index)
Expand Down
3 changes: 3 additions & 0 deletions src/sakia/tests/unit/gui/test_main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ def test_change_account(self):
label_status = Mock()
label_time = Mock()
combo_referentials = Mock()
combo_referentials.currentIndexChanged = {int: Mock()}
mainwindow = MainWindow(self.app, self.account_joe, self.homescreen, self.community_view, widget, ui, label_icon,
label_status, label_time, combo_referentials, self.password_asker)
mainwindow.refresh = Mock()
mainwindow.action_change_account("doe")

self.app.change_current_account.assert_called_once_with(self.account_doe)
mainwindow.change_account()

Expand All @@ -69,6 +71,7 @@ def test_change_account_from_none(self):
label_status = Mock()
label_time = Mock()
combo_referentials = Mock()
combo_referentials.currentIndexChanged = {int: Mock()}
type(self.app).current_account = PropertyMock(return_value=None)
mainwindow = MainWindow(self.app, None, self.homescreen, self.community_view, widget, ui, label_icon,
label_status, label_time, combo_referentials, self.password_asker)
Expand Down

0 comments on commit 6324007

Please sign in to comment.