Skip to content

Commit

Permalink
fixup! WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
matrss committed Feb 23, 2024
1 parent 0317aa4 commit 57f01b4
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tests/_test_msui/test_mscolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,20 @@ def test_disconnect(self):
# set ui_name_winodw default
assert self.main_window.usernameLabel.text() == 'User'

def test_login(self):
def test_login(self, qtbot):
self._connect_to_mscolab()
modify_config_file({"MSS_auth": {self.url: self.userdata[0]}})
self._login(self.userdata[0], self.userdata[2])
QtWidgets.QApplication.processEvents()
# show logged in widgets
assert self.main_window.usernameLabel.text() == self.userdata[1]
assert self.main_window.connectBtn.isVisible() is False
assert self.main_window.mscolab.connect_window is None
assert self.main_window.local_active is True
# test operation listing visibility
assert self.main_window.listOperationsMSC.model().rowCount() == 1

def assert_():
# show logged in widgets
assert self.main_window.usernameLabel.text() == self.userdata[1]
assert self.main_window.connectBtn.isVisible() is False
assert self.main_window.mscolab.connect_window is None
assert self.main_window.local_active is True
# test operation listing visibility
assert self.main_window.listOperationsMSC.model().rowCount() == 1
qtbot.wait_until(assert_)

@mock.patch("PyQt5.QtWidgets.QMessageBox.question", return_value=QtWidgets.QMessageBox.Yes)
def test_login_with_different_account_shows_update_credentials_popup(self, mockbox):
Expand Down

0 comments on commit 57f01b4

Please sign in to comment.