Skip to content

Commit

Permalink
merge mistake fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ReimarBauer committed Aug 6, 2021
1 parent 7fd3765 commit 769b98a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
20 changes: 0 additions & 20 deletions mslib/msui/_tests/test_mscolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,26 +290,6 @@ def __init__(self, code, text):
# causes 4 instead of 3 messages, I am not sure if this is on purpose.
assert mockbox.return_value.showMessage.call_count == 4

@mock.patch("mslib.msui.mscolab.MSCOLAB_AuthenticationDialog.exec_", return_value=QtWidgets.QDialog.Accepted)
@mock.patch("PyQt5.QtWidgets.QErrorMessage")
def test_failed_authorize(self, mockbox, mockauth):
class response:
def __init__(self, code, text):
self.status_code = code
self.text = text

self._connect_to_mscolab()
with mock.patch("requests.Session.post", new=ExceptionMock(requests.exceptions.ConnectionError).raise_exc):
self._login()
with mock.patch("requests.Session.post", return_value=response(201, "False")):
self._login()
with mock.patch("requests.Session.post", return_value=response(401, "False")):
self._login()

# No return after self.error_dialog.showMessage('Oh no, server authentication were incorrect.')
# causes 4 instead of 3 messages, I am not sure if this is on purpose.
assert mockbox.return_value.showMessage.call_count == 4

def test_add_user(self):
self._connect_to_mscolab()
self._create_user("something", "something@something.org", "something")
Expand Down
12 changes: 0 additions & 12 deletions mslib/mswms/_tests/test_mss_plot_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,6 @@
import mslib.mswms.gallery_builder


def is_image_transparent(img):
with Image.open(io.BytesIO(img)) as image:
if image.mode == "P":
transparent = image.info.get("transparency", -1)
for _, index in image.getcolors():
if index == transparent:
return True
elif image.mode == "RGBA":
return image.getextrema()[3][0] < 255
return False


def is_image_transparent(img):
with Image.open(io.BytesIO(img)) as image:
if image.mode == "P":
Expand Down

0 comments on commit 769b98a

Please sign in to comment.