Skip to content

Commit

Permalink
few todos solved (#2650)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Matthias Riße <9308656+matrss@users.noreply.github.com>
  • Loading branch information
ReimarBauer and matrss authored Feb 21, 2025
1 parent 7a0907e commit aed300b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
5 changes: 2 additions & 3 deletions mslib/msui/mscolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ def on_context_menu(point):
self.profile_dialog.usernameLabel_2.setText(self.user['username'])
self.profile_dialog.mscolabURLLabel_2.setText(self.mscolab_server_url)
self.profile_dialog.emailLabel_2.setText(self.email)
self.profile_dialog.deleteAccountBtn.clicked.connect(self.delete_account)
self.profile_dialog.deleteAccountBtn.clicked.connect(self.delete_own_account)
self.profile_dialog.uploadImageBtn.clicked.connect(self.upload_image)

# add context menu for right click on image
Expand Down Expand Up @@ -928,8 +928,7 @@ def upload_image(self, _=None):
f'Cannot identify image file. Please check the file format. Error: {e}')

@verify_user_token
def delete_account(self, _=None):
# ToDo rename to delete_own_account
def delete_own_account(self, _=None):
reply = QMessageBox.question(
self.ui, self.tr('Continue?'),
self.tr("You're about to delete your account. You cannot undo this operation!"),
Expand Down
41 changes: 15 additions & 26 deletions tests/_test_mscolab/test_sockets_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,14 @@ def test_get_messages(self):
sio = self._connect()
sio.emit('start', {'token': self.token})

# ToDo same message gets twice emitted, why? (use a helper function)
sio.emit("chat-message", {
"op_id": self.operation.id,
"token": self.token,
"message_text": "message from 1",
"reply_id": -1
})
sio.emit("chat-message", {
"op_id": self.operation.id,
"token": self.token,
"message_text": "message from 1",
"reply_id": -1
})
for _ in range(2):
sio.emit("chat-message", {
"op_id": self.operation.id,
"token": self.token,
"message_text": "message from 1",
"reply_id": -1
})

with self.app.app_context():
messages = self.cm.get_messages(1)
assert messages[0]["text"] == "message from 1"
Expand All @@ -195,19 +190,13 @@ def test_get_messages(self):
def test_get_messages_api(self):
sio = self._connect()
sio.emit('start', {'token': self.token})
# ToDo same message gets twice emitted, why?
sio.emit("chat-message", {
"op_id": self.operation.id,
"token": self.token,
"message_text": "message from 1",
"reply_id": -1
})
sio.emit("chat-message", {
"op_id": self.operation.id,
"token": self.token,
"message_text": "message from 1",
"reply_id": -1
})
for _ in range(2):
sio.emit("chat-message", {
"op_id": self.operation.id,
"token": self.token,
"message_text": "message from 1",
"reply_id": -1
})

token = self.token
data = {
Expand Down

0 comments on commit aed300b

Please sign in to comment.