Skip to content

Commit

Permalink
Fixed unit tests.
Browse files Browse the repository at this point in the history
see #85
  • Loading branch information
tonioo committed Jul 24, 2017
1 parent b7d811e commit e145e97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modoboa_webmail/lib/imaputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def _listmboxes_simple(self, topmailbox='INBOX', mailboxes=None, **kwargs):
for mb in data:
flags, delimiter, name = self.list_response_pattern.match(
mb.decode()).groups()
name = name.strip('"').decode("imap4-utf-7")
name = bytearray(name.strip('"'), "utf-8").decode("imap4-utf-7")
mdm_found = False
for idx, mdm in enumerate(mailboxes):
if mdm["name"] == name:
Expand Down
8 changes: 5 additions & 3 deletions modoboa_webmail/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Webmail tests."""

from __future__ import unicode_literals

import os
import shutil
import tempfile
Expand Down Expand Up @@ -35,9 +37,9 @@ def _quote(self, data):

def _simple_command(self, name, *args, **kwargs):
if name == "CAPABILITY":
self.untagged_responses["CAPABILITY"] = [""]
self.untagged_responses["CAPABILITY"] = [b""]
elif name == "LIST":
self.untagged_responses["LIST"] = ["() \".\" \"INBOX\""]
self.untagged_responses["LIST"] = [b"() \".\" \"INBOX\""]
return "OK", None

def append(self, *args, **kwargs):
Expand All @@ -50,7 +52,7 @@ def delete(self, name):
return "OK", None

def list(self):
return "OK", ["() \".\" \"INBOX\""]
return "OK", [b"() \".\" \"INBOX\""]

def rename(self, oldname, newname):
return "OK", None
Expand Down

0 comments on commit e145e97

Please # to comment.