============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-9.0.3, pluggy-1.6.0
rootdir: /workspace/imapclient
configfile: pyproject.toml
plugins: anyio-4.13.0, metadata-3.1.1, json-report-1.5.0, cov-7.1.0
collected 267 items

tests/test_auth.py FFF                                                   [  1%]
tests/test_datetime_util.py ........                                     [  4%]
tests/test_enable.py FFFFF                                               [  5%]
tests/test_fixed_offset.py ......                                        [  8%]
tests/test_folder_status.py FFF                                          [  9%]
tests/test_imap_utf7.py ...                                              [ 10%]
tests/test_imapclient.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.F.FFFF [ 28%]
FFF..FFFFFF.FFFFFFFFFFFFFFF.FF                                           [ 39%]
tests/test_init.py .......                                               [ 41%]
tests/test_response_lexer.py ...........F..                              [ 47%]
tests/test_response_parser.py .......................................... [ 62%]
.............                                                            [ 67%]
tests/test_search.py FFFFFFFFFFFFFFFFFFFF                                [ 75%]
tests/test_sort.py FF.F                                                  [ 76%]
tests/test_starttls.py FFFF                                              [ 78%]
tests/test_store.py .FFFFFFFF                                            [ 81%]
tests/test_thread.py FFFF                                                [ 83%]
tests/test_util_functions.py ........................................    [ 98%]
tests/test_version.py .....                                              [100%]

=================================== FAILURES ===================================
___________________________ TestPlainLogin.test_fail ___________________________

self = <tests.test_auth.TestPlainLogin testMethod=test_fail>

    def test_fail(self):
        self.client._imap.authenticate.return_value = ("NO", [b"Boom"])
>       self.assertRaises(LoginError, self.client.plain_login, "user", "secret")
E       AssertionError: LoginError not raised by plain_login

tests/test_auth.py:26: AssertionError
__________________________ TestPlainLogin.test_simple __________________________

self = <tests.test_auth.TestPlainLogin testMethod=test_simple>

    def test_simple(self):
        self.client._imap.authenticate.return_value = ("OK", [b"Success"])
        result = self.client.plain_login("user", "secret")
>       self.assertEqual(result, b"Success")
E       AssertionError: None != b'Success'

tests/test_auth.py:21: AssertionError
_______________ TestPlainLogin.test_with_authorization_identity ________________

self = <tests.test_auth.TestPlainLogin testMethod=test_with_authorization_identity>

    def test_with_authorization_identity(self):
        self.client._imap.authenticate.return_value = ("OK", [b"Success"])
        result = self.client.plain_login("user", "secret", "authid")
>       self.assertEqual(result, b"Success")
E       AssertionError: None != b'Success'

tests/test_auth.py:31: AssertionError
___________________________ TestEnable.test_failed1 ____________________________

self = <tests.test_enable.TestEnable testMethod=test_failed1>

    def test_failed1(self):
        # When server returns an empty ENABLED response
        self.command.return_value = b""
    
        resp = self.client.enable("FOO")
    
>       self.command.assert_called_once_with(
            b"ENABLE", [b"FOO"], uid=False, response_name="ENABLED", unpack=True
        )

tests/test_enable.py:36: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007567191024'>, args = (b'ENABLE', [b'FOO'])
kwargs = {'response_name': 'ENABLED', 'uid': False, 'unpack': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
___________________________ TestEnable.test_failed2 ____________________________

self = <tests.test_enable.TestEnable testMethod=test_failed2>

    def test_failed2(self):
        # When server returns no ENABLED response
        self.command.return_value = None
    
        resp = self.client.enable("FOO")
    
>       self.command.assert_called_once_with(
            b"ENABLE", [b"FOO"], uid=False, response_name="ENABLED", unpack=True
        )

tests/test_enable.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007568811120'>, args = (b'ENABLE', [b'FOO'])
kwargs = {'response_name': 'ENABLED', 'uid': False, 'unpack': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
___________________________ TestEnable.test_multiple ___________________________

self = <tests.test_enable.TestEnable testMethod=test_multiple>

    def test_multiple(self):
        self.command.return_value = b"FOO BAR"
    
        resp = self.client.enable("FOO", "BAR")
    
>       self.command.assert_called_once_with(
            b"ENABLE", [b"FOO", b"BAR"], uid=False, response_name="ENABLED", unpack=True
        )

tests/test_enable.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007563295376'>, args = (b'ENABLE', [b'FOO', b'BAR'])
kwargs = {'response_name': 'ENABLED', 'uid': False, 'unpack': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
___________________________ TestEnable.test_success ____________________________

self = <tests.test_enable.TestEnable testMethod=test_success>

    def test_success(self):
        self.command.return_value = b"CONDSTORE"
    
        resp = self.client.enable("CONDSTORE")
    
>       self.command.assert_called_once_with(
            b"ENABLE", [b"CONDSTORE"], uid=False, response_name="ENABLED", unpack=True
        )

tests/test_enable.py:25: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564917392'>, args = (b'ENABLE', [b'CONDSTORE'])
kwargs = {'response_name': 'ENABLED', 'uid': False, 'unpack': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
_________________________ TestEnable.test_wrong_state __________________________

self = <tests.test_enable.TestEnable testMethod=test_wrong_state>

    def test_wrong_state(self):
        self.client._imap.state = "SELECTED"
    
>       self.assertRaises(
            IllegalStateError,
            self.client.enable,
            "FOO",
        )
E       AssertionError: IllegalStateError not raised by enable

tests/test_enable.py:65: AssertionError
_________________________ TestFolderStatus.test_basic __________________________

self = <tests.test_folder_status.TestFolderStatus testMethod=test_basic>

    def test_basic(self):
        self.client._imap.status.return_value = (
            "OK",
            [b"foo (MESSAGES 3 RECENT 0 UIDNEXT 4 UIDVALIDITY 1435636895 UNSEEN 0)"],
        )
    
        out = self.client.folder_status("foo")
    
>       self.client._imap.status.assert_called_once_with(
            b'"foo"', "(MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)"
        )

tests/test_folder_status.py:19: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock.status' id='124007564493056'>
args = (b'"foo"', '(MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)'), kwargs = {}
msg = "Expected 'status' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'status' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
_____________________ TestFolderStatus.test_extra_response _____________________

self = <tests.test_folder_status.TestFolderStatus testMethod=test_extra_response>

    def test_extra_response(self):
        # In production, we've seen folder names containing spaces come back
        # like this and be broken into two components in the tuple.
        server_response = [b"My files (UIDNEXT 24369)"]
        mock = Mock(return_value=server_response)
        self.client._command_and_check = mock
    
        resp = self.client.folder_status("My files", ["UIDNEXT"])
>       self.assertEqual(resp, {b"UIDNEXT": 24369})
E       AssertionError: None != {b'UIDNEXT': 24369}

tests/test_folder_status.py:52: AssertionError
________________________ TestFolderStatus.test_literal _________________________

self = <tests.test_folder_status.TestFolderStatus testMethod=test_literal>

    def test_literal(self):
        self.client._imap.status.return_value = (
            "OK",
            [(b"{3}", b"foo"), b" (UIDNEXT 4)"],
        )
    
        out = self.client.folder_status("foo", ["UIDNEXT"])
    
>       self.client._imap.status.assert_called_once_with(b'"foo"', "(UIDNEXT)")

tests/test_folder_status.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock.status' id='124007568804640'>
args = (b'"foo"', '(UIDNEXT)'), kwargs = {}
msg = "Expected 'status' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'status' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
_________________________ TestListFolders.test_blanks __________________________

self = <tests.test_imapclient.TestListFolders testMethod=test_blanks>

    def test_blanks(self):
>       folders = self.client._proc_folder_list(
            ["", None, rb'(\HasNoChildren) "/" "last"']
        )
E       AttributeError: 'TestableIMAPClient' object has no attribute '_proc_folder_list'

tests/test_imapclient.py:229: AttributeError
_____________________ TestListFolders.test_empty_response ______________________

self = <tests.test_imapclient.TestListFolders testMethod=test_empty_response>

    def test_empty_response(self):
>       self.assertEqual(self.client._proc_folder_list([None]), [])
E       AttributeError: 'TestableIMAPClient' object has no attribute '_proc_folder_list'

tests/test_imapclient.py:226: AttributeError
____________________ TestListFolders.test_folder_encode_off ____________________

self = <tests.test_imapclient.TestListFolders testMethod=test_folder_encode_off>

    def test_folder_encode_off(self):
        self.client.folder_encode = False
        self.client._imap._simple_command.return_value = ("OK", [b"something"])
        self.client._imap._untagged_response.return_value = (
            "LIST",
            [
                b'(\\HasNoChildren) "/" "A"',
                b'(\\HasNoChildren) "/" "Hello&AP8-world"',
            ],
        )
    
        folders = self.client.list_folders("foo", "bar")
    
>       self.client._imap._simple_command.assert_called_once_with(
            "LIST", '"foo"', '"bar"'
        )

tests/test_imapclient.py:111: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock._simple_command' id='124007565196016'>
args = ('LIST', '"foo"', '"bar"'), kwargs = {}
msg = "Expected '_simple_command' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected '_simple_command' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
____________________ TestListFolders.test_funky_characters _____________________

self = <tests.test_imapclient.TestListFolders testMethod=test_funky_characters>

    def test_funky_characters(self):
>       folders = self.client._proc_folder_list(
            [
                (b'(\\NoInferiors \\UnMarked) "/" {5}', "bang\xff"),
                b"",
                b'(\\HasNoChildren \\UnMarked) "/" "INBOX"',
            ]
        )
E       AttributeError: 'TestableIMAPClient' object has no attribute '_proc_folder_list'

tests/test_imapclient.py:189: AttributeError
______________________ TestListFolders.test_list_folders _______________________

self = <tests.test_imapclient.TestListFolders testMethod=test_list_folders>

    def test_list_folders(self):
        self.client._imap._simple_command.return_value = ("OK", [b"something"])
        self.client._imap._untagged_response.return_value = (
            "LIST",
            sentinel.folder_data,
        )
        self.client._proc_folder_list = Mock(return_value=sentinel.folder_list)
    
        folders = self.client.list_folders("foo", "bar")
    
>       self.client._imap._simple_command.assert_called_once_with(
            "LIST", b'"foo"', b'"bar"'
        )

tests/test_imapclient.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock._simple_command' id='124007564876272'>
args = ('LIST', b'"foo"', b'"bar"'), kwargs = {}
msg = "Expected '_simple_command' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected '_simple_command' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
_____________________ TestListFolders.test_list_folders_NO _____________________

self = <tests.test_imapclient.TestListFolders testMethod=test_list_folders_NO>

    def test_list_folders_NO(self):
        self.client._imap._simple_command.return_value = ("NO", [b"badness"])
>       self.assertRaises(IMAPClientError, self.client.list_folders)
E       AssertionError: error not raised by list_folders

tests/test_imapclient.py:69: AssertionError
____________________ TestListFolders.test_list_sub_folders _____________________

self = <tests.test_imapclient.TestListFolders testMethod=test_list_sub_folders>

    def test_list_sub_folders(self):
        self.client._imap._simple_command.return_value = ("OK", [b"something"])
        self.client._imap._untagged_response.return_value = (
            "LSUB",
            sentinel.folder_data,
        )
        self.client._proc_folder_list = Mock(return_value=sentinel.folder_list)
    
        folders = self.client.list_sub_folders("foo", "bar")
    
>       self.client._imap._simple_command.assert_called_once_with(
            "LSUB", b'"foo"', b'"bar"'
        )

tests/test_imapclient.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock._simple_command' id='124007564663472'>
args = ('LSUB', b'"foo"', b'"bar"'), kwargs = {}
msg = "Expected '_simple_command' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected '_simple_command' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
___________________ TestListFolders.test_list_sub_folders_NO ___________________

self = <tests.test_imapclient.TestListFolders testMethod=test_list_sub_folders_NO>

    def test_list_sub_folders_NO(self):
        self.client._imap._simple_command.return_value = ("NO", [b"badness"])
>       self.assertRaises(IMAPClientError, self.client.list_folders)
E       AssertionError: error not raised by list_folders

tests/test_imapclient.py:73: AssertionError
__________________________ TestListFolders.test_mixed __________________________

self = <tests.test_imapclient.TestListFolders testMethod=test_mixed>

    def test_mixed(self):
>       folders = self.client._proc_folder_list(
            [
                b'(\\HasNoChildren) "/" Alpha',
                b'(\\HasNoChildren) "/" "Foo Bar"',
                b'(\\HasNoChildren) "/" C',
            ]
        )
E       AttributeError: 'TestableIMAPClient' object has no attribute '_proc_folder_list'

tests/test_imapclient.py:172: AttributeError
_____________________ TestListFolders.test_quoted_specials _____________________

self = <tests.test_imapclient.TestListFolders testMethod=test_quoted_specials>

    def test_quoted_specials(self):
>       folders = self.client._proc_folder_list(
            [
                rb'(\HasNoChildren) "/" "Test \"Folder\""',
                rb'(\HasNoChildren) "/" "Left\"Right"',
                rb'(\HasNoChildren) "/" "Left\\Right"',
                rb'(\HasNoChildren) "/" "\"Left Right\""',
                rb'(\HasNoChildren) "/" "\"Left\\Right\""',
            ]
        )
E       AttributeError: 'TestableIMAPClient' object has no attribute '_proc_folder_list'

tests/test_imapclient.py:205: AttributeError
_________________________ TestListFolders.test_simple __________________________

self = <tests.test_imapclient.TestListFolders testMethod=test_simple>

    def test_simple(self):
>       folders = self.client._proc_folder_list(
            [
                b'(\\HasNoChildren) "/" "A"',
                b'(\\HasNoChildren) "/" "Foo Bar"',
            ]
        )
E       AttributeError: 'TestableIMAPClient' object has no attribute '_proc_folder_list'

tests/test_imapclient.py:123: AttributeError
______________ TestListFolders.test_unquoted_numeric_folder_name _______________

self = <tests.test_imapclient.TestListFolders testMethod=test_unquoted_numeric_folder_name>

    def test_unquoted_numeric_folder_name(self):
        # Some IMAP implementations do this
>       folders = self.client._proc_folder_list([b'(\\HasNoChildren) "/" 123'])
E       AttributeError: 'TestableIMAPClient' object has no attribute '_proc_folder_list'

tests/test_imapclient.py:160: AttributeError
_______ TestListFolders.test_unquoted_numeric_folder_name_parsed_as_long _______

self = <tests.test_imapclient.TestListFolders testMethod=test_unquoted_numeric_folder_name_parsed_as_long>

    def test_unquoted_numeric_folder_name_parsed_as_long(self):
        # big enough numeric values might get parsed as longs
        folder_name = str(sys.maxsize + 1)
>       folders = self.client._proc_folder_list(
            [b'(\\HasNoChildren) "/" ' + folder_name.encode("ascii")]
        )
E       AttributeError: 'TestableIMAPClient' object has no attribute '_proc_folder_list'

tests/test_imapclient.py:166: AttributeError
______________________ TestListFolders.test_utf7_decoding ______________________

self = <tests.test_imapclient.TestListFolders testMethod=test_utf7_decoding>

    def test_utf7_decoding(self):
        self.client._imap._simple_command.return_value = ("OK", [b"something"])
        self.client._imap._untagged_response.return_value = (
            "LIST",
            [
                b'(\\HasNoChildren) "/" "A"',
                b'(\\HasNoChildren) "/" "Hello&AP8-world"',
            ],
        )
    
        folders = self.client.list_folders("foo", "bar")
    
>       self.client._imap._simple_command.assert_called_once_with(
            "LIST", b'"foo"', b'"bar"'
        )

tests/test_imapclient.py:87: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock._simple_command' id='124007563250752'>
args = ('LIST', b'"foo"', b'"bar"'), kwargs = {}
msg = "Expected '_simple_command' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected '_simple_command' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
_____________________ TestListFolders.test_without_quotes ______________________

self = <tests.test_imapclient.TestListFolders testMethod=test_without_quotes>

    def test_without_quotes(self):
>       folders = self.client._proc_folder_list(
            [
                b'(\\HasNoChildren) "/" A',
                b'(\\HasNoChildren) "/" B',
                b'(\\HasNoChildren) "/" C',
            ]
        )
E       AttributeError: 'TestableIMAPClient' object has no attribute '_proc_folder_list'

tests/test_imapclient.py:142: AttributeError
_______ TestFindSpecialFolder.test_find_special_folder_with_special_use ________

self = <tests.test_imapclient.TestFindSpecialFolder testMethod=test_find_special_folder_with_special_use>

    def test_find_special_folder_with_special_use(self):
        self.client._cached_capabilities = (b"SPECIAL-USE",)
        self.client._imap._simple_command.return_value = ("OK", [b"something"])
        self.client._imap._untagged_response.return_value = (
            "LIST",
            [
                b'(\\HasNoChildren) "/" "INBOX"',
                b'(\\HasNoChildren \\Sent) "/" "Sent"',
            ],
        )
    
        folder = self.client.find_special_folder(b"\\Sent")
    
>       self.assertEqual(folder, "Sent")
E       AssertionError: None != 'Sent'

tests/test_imapclient.py:249: AssertionError
_ TestFindSpecialFolder.test_find_special_folder_with_special_use_single_flag __

self = <tests.test_imapclient.TestFindSpecialFolder testMethod=test_find_special_folder_with_special_use_single_flag>

    def test_find_special_folder_with_special_use_single_flag(self):
        self.client._cached_capabilities = (b"SPECIAL-USE",)
        self.client._imap._simple_command.return_value = ("OK", [b"something"])
        self.client._imap._untagged_response.return_value = (
            "LIST",
            [
                b'(\\HasNoChildren) "/" "INBOX"',
                b'(\\Sent) "/" "Sent"',
            ],
        )
    
        folder = self.client.find_special_folder(b"\\Sent")
    
>       self.assertEqual(folder, "Sent")
E       AssertionError: None != 'Sent'

tests/test_imapclient.py:264: AssertionError
_ TestFindSpecialFolder.test_find_special_folder_without_special_use_nor_namespace _

self = <tests.test_imapclient.TestFindSpecialFolder testMethod=test_find_special_folder_without_special_use_nor_namespace>

    def test_find_special_folder_without_special_use_nor_namespace(self):
        self.client._cached_capabilities = (b"FOO",)
        self.client._imap._simple_command.return_value = ("OK", [b"something"])
        self.client._imap._untagged_response.return_value = (
            "LIST",
            [
                b'(\\HasNoChildren) "/" "Sent Items"',
            ],
        )
    
        folder = self.client.find_special_folder(b"\\Sent")
    
>       self.assertEqual(folder, "Sent Items")
E       AssertionError: None != 'Sent Items'

tests/test_imapclient.py:278: AssertionError
_________________________ TestSelectFolder.test_normal _________________________

self = <tests.test_imapclient.TestSelectFolder testMethod=test_normal>

    def test_normal(self):
        self.client._command_and_check = Mock()
        self.client._imap.untagged_responses = {
            b"exists": [b"3"],
            b"FLAGS": [rb"(\Flagged \Deleted abc [foo]/bar def)"],
            b"HIGHESTMODSEQ": [b"127110"],
            b"OK": [
                rb"[PERMANENTFLAGS (\Flagged \Deleted abc [foo]/bar def \*)] Flags permitted.",
                b"[UIDVALIDITY 631062293] UIDs valid.",
                b"[UIDNEXT 1281] Predicted next UID.",
                b"[HIGHESTMODSEQ 127110]",
            ],
            b"PERMANENTFLAGS": [rb"(\Flagged \Deleted abc [foo"],
            b"READ-WRITE": [b""],
            b"RECENT": [b"0"],
            b"UIDNEXT": [b"1281"],
            b"UIDVALIDITY": [b"631062293"],
            b"OTHER": [b"blah"],
        }
    
        result = self.client.select_folder(b"folder_name", sentinel.readonly)
    
>       self.client._command_and_check.assert_called_once_with(
            "select", b'"folder_name"', sentinel.readonly
        )

tests/test_imapclient.py:304: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564662416'>
args = ('select', b'"folder_name"', sentinel.readonly), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
________________________ TestSelectFolder.test_unselect ________________________

self = <tests.test_imapclient.TestSelectFolder testMethod=test_unselect>

    def test_unselect(self):
        self.client._cached_capabilities = [b"UNSELECT"]
        self.client._imap._simple_command.return_value = ("OK", ["Unselect completed."])
        # self.client._imap._untagged_response.return_value = (
        #    b'OK', [b'("name" "GImap" "vendor" "Google, Inc.")'])
    
        result = self.client.unselect_folder()
>       self.assertEqual(result, "Unselect completed.")
E       AssertionError: None != 'Unselect completed.'

tests/test_imapclient.py:337: AssertionError
_________________________ TestAppend.test_multiappend __________________________

self = <tests.test_imapclient.TestAppend testMethod=test_multiappend>

    def test_multiappend(self):
        self.client._cached_capabilities = (b"MULTIAPPEND",)
        self.client._raw_command = Mock()
        self.client.multiappend("foobar", ["msg1", "msg2"])
    
>       self.client._raw_command.assert_called_once_with(
            b"APPEND", [b'"foobar"', b"msg1", b"msg2"], uid=False
        )

tests/test_imapclient.py:375: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564658432'>
args = (b'APPEND', [b'"foobar"', b'msg1', b'msg2']), kwargs = {'uid': False}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
___________ TestAppend.test_multiappend_with_flags_and_internaldate ____________

self = <tests.test_imapclient.TestAppend testMethod=test_multiappend_with_flags_and_internaldate>

    def test_multiappend_with_flags_and_internaldate(self):
        self.client._cached_capabilities = (b"MULTIAPPEND",)
        self.client._raw_command = Mock()
        self.client.multiappend(
            "foobar",
            [
                {
                    "msg": "msg1",
                    "flags": ["FLAG", "WAVE"],
                    "date": datetime(2009, 4, 5, 11, 0, 5, 0, FixedOffset(2 * 60)),
                },
                {
                    "msg": "msg2",
                    "flags": ["FLAG", "WAVE"],
                },
                {
                    "msg": "msg3",
                    "date": datetime(2009, 4, 5, 11, 0, 5, 0, FixedOffset(2 * 60)),
                },
            ],
        )
    
>       self.client._raw_command.assert_called_once_with(
            b"APPEND",
            [
                b'"foobar"',
                b"(FLAG WAVE)",
                b'"05-Apr-2009 11:00:05 +0200"',
                _literal(b"msg1"),
                b"(FLAG WAVE)",
                _literal(b"msg2"),
                b'"05-Apr-2009 11:00:05 +0200"',
                _literal(b"msg3"),
            ],
            uid=False,
        )

tests/test_imapclient.py:401: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564633200'>
args = (b'APPEND', [b'"foobar"', b'(FLAG WAVE)', b'"05-Apr-2009 11:00:05 +0200"', b'msg1', b'(FLAG WAVE)', b'msg2', ...])
kwargs = {'uid': False}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
________________________ TestAppend.test_with_msg_time _________________________

self = <tests.test_imapclient.TestAppend testMethod=test_with_msg_time>
datetime_to_INTERNALDATE = <MagicMock name='datetime_to_INTERNALDATE' id='124007564665920'>

    @patch("imapclient.imapclient.datetime_to_INTERNALDATE")
    def test_with_msg_time(self, datetime_to_INTERNALDATE):
        datetime_to_INTERNALDATE.return_value = "somedate"
        self.client._imap.append.return_value = ("OK", [b"Good"])
        msg = b"bye"
    
        self.client.append(
            "foobar",
            msg,
            ["FLAG", "WAVE"],
            datetime(2009, 4, 5, 11, 0, 5, 0, FixedOffset(2 * 60)),
        )
    
>       self.assertTrue(datetime_to_INTERNALDATE.called)
E       AssertionError: False is not true

tests/test_imapclient.py:365: AssertionError
_______________________ TestAppend.test_without_msg_time _______________________

self = <tests.test_imapclient.TestAppend testMethod=test_without_msg_time>

    def test_without_msg_time(self):
        self.client._imap.append.return_value = ("OK", [b"Good"])
        msg = "hi"
    
        self.client.append("foobar", msg, ["FLAG", "WAVE"], None)
    
>       self.client._imap.append.assert_called_with(
            b'"foobar"', "(FLAG WAVE)", None, b"hi"
        )

tests/test_imapclient.py:348: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock.append' id='124007564501216'>
args = (b'"foobar"', '(FLAG WAVE)', None, b'hi'), kwargs = {}
expected = 'append(b\'"foobar"\', \'(FLAG WAVE)\', None, b\'hi\')'
actual = 'not called.'
error_message = 'expected call not found.\nExpected: append(b\'"foobar"\', \'(FLAG WAVE)\', None, b\'hi\')\nActual: not called.'

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
>           raise AssertionError(error_message)
E           AssertionError: expected call not found.
E           Expected: append(b'"foobar"', '(FLAG WAVE)', None, b'hi')
E           Actual: not called.

/usr/lib/python3.10/unittest/mock.py:920: AssertionError
__________________________ TestAclMethods.test_getacl __________________________

self = <tests.test_imapclient.TestAclMethods testMethod=test_getacl>

    def test_getacl(self):
        self.client._imap.getacl.return_value = (
            "OK",
            [b"INBOX Fred rwipslda Sally rwip"],
        )
        acl = self.client.getacl("INBOX")
>       self.assertSequenceEqual(acl, [(b"Fred", b"rwipslda"), (b"Sally", b"rwip")])
E       AssertionError: First sequence has no length.    Non-sequence?
E       - None
E       + [(b'Fred', b'rwipslda'), (b'Sally', b'rwip')]

tests/test_imapclient.py:428: AssertionError
__________________________ TestAclMethods.test_setacl __________________________

self = <tests.test_imapclient.TestAclMethods testMethod=test_setacl>

    def test_setacl(self):
        self.client._imap.setacl.return_value = ("OK", [b"SETACL done"])
    
        response = self.client.setacl("folder", sentinel.who, sentinel.what)
    
>       self.client._imap.setacl.assert_called_with(
            b'"folder"', sentinel.who, sentinel.what
        )

tests/test_imapclient.py:435: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock.setacl' id='124007565186992'>
args = (b'"folder"', sentinel.who, sentinel.what), kwargs = {}
expected = 'setacl(b\'"folder"\', sentinel.who, sentinel.what)'
actual = 'not called.'
error_message = 'expected call not found.\nExpected: setacl(b\'"folder"\', sentinel.who, sentinel.what)\nActual: not called.'

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
>           raise AssertionError(error_message)
E           AssertionError: expected call not found.
E           Expected: setacl(b'"folder"', sentinel.who, sentinel.what)
E           Actual: not called.

/usr/lib/python3.10/unittest/mock.py:920: AssertionError
__________________________ TestQuota.test__get_quota ___________________________

self = <tests.test_imapclient.TestQuota testMethod=test__get_quota>

    def test__get_quota(self):
        self.client._command_and_check = Mock()
        self.client._command_and_check.return_value = [
            b'"User quota" (MESSAGES 42 1000)'
        ]
    
        quotas = self.client._get_quota("foo")
    
>       self.client._command_and_check.assert_called_once_with("getquota", '"foo"')

tests/test_imapclient.py:484: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007567187952'>, args = ('getquota', '"foo"'), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
________________________ TestQuota.test_get_quota_root _________________________

self = <tests.test_imapclient.TestQuota testMethod=test_get_quota_root>

    def test_get_quota_root(self):
        self.client._raw_command_untagged = Mock()
        self.client._raw_command_untagged.return_value = [b'"INBOX" "User quota"']
        self.client._imap.untagged_responses = dict()
    
        resp = self.client.get_quota_root("INBOX")
    
>       self.client._raw_command_untagged.assert_called_once_with(
            b"GETQUOTAROOT", b"INBOX", uid=False, response_name="QUOTAROOT"
        )

tests/test_imapclient.py:513: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007563257184'>, args = (b'GETQUOTAROOT', b'INBOX')
kwargs = {'response_name': 'QUOTAROOT', 'uid': False}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
__________________________ TestQuota.test_parse_quota __________________________

self = <tests.test_imapclient.TestQuota testMethod=test_parse_quota>

    def test_parse_quota(self):
        self.assertEqual(_parse_quota([]), [])
>       self.assertEqual(
            _parse_quota([b'"User quota" (STORAGE 586720 4882812)']),
            [Quota("User quota", "STORAGE", 586720, 4882812)],
        )
E       AssertionError: Lists differ: [] != [Quota(quota_root='User quota', resource='[34 chars]812)]
E       
E       Second list contains 1 additional elements.
E       First extra element 0:
E       Quota(quota_root='User quota', resource='STORAGE', usage=586720, limit=4882812)
E       
E       - []
E       + [Quota(quota_root='User quota',
E       +        resource='STORAGE',
E       +        usage=586720,
E       +        limit=4882812)]

tests/test_imapclient.py:448: AssertionError
___________________________ TestQuota.test_set_quota ___________________________

self = <tests.test_imapclient.TestQuota testMethod=test_set_quota>

    def test_set_quota(self):
        self.client._raw_command_untagged = Mock()
        self.client._raw_command_untagged.return_value = [
            b'"User quota" (STORAGE 42 1000 MESSAGES 42 1000)'
        ]
        quotas = [
            Quota("User quota", "STORAGE", 42, 1000),
            Quota("User quota", "MESSAGES", 42, 1000),
        ]
        resp = self.client.set_quota(quotas)
    
>       self.client._raw_command_untagged.assert_called_once_with(
            b"SETQUOTA",
            [b'"User quota"', b"(STORAGE 1000 MESSAGES 1000)"],
            uid=False,
            response_name="QUOTA",
        )

tests/test_imapclient.py:498: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564870368'>
args = (b'SETQUOTA', [b'"User quota"', b'(STORAGE 1000 MESSAGES 1000)'])
kwargs = {'response_name': 'QUOTA', 'uid': False}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
______________ TestIdleAndNoop.test_consume_until_tagged_response ______________

self = <tests.test_imapclient.TestIdleAndNoop testMethod=test_consume_until_tagged_response>

    def test_consume_until_tagged_response(self):
        client = self.client
        client._imap.tagged_commands = {sentinel.tag: None}
    
        counter = itertools.count()
    
        def fake_get_response():
            count = next(counter)
            if count == 0:
                return b"* 99 EXISTS"
            client._imap.tagged_commands[sentinel.tag] = ("OK", [b"Idle done"])
    
        client._imap._get_response = fake_get_response
    
>       text, responses = client._consume_until_tagged_response(sentinel.tag, b"IDLE")
E       AttributeError: 'TestableIMAPClient' object has no attribute '_consume_until_tagged_response'

tests/test_imapclient.py:734: AttributeError
__________________________ TestIdleAndNoop.test_idle ___________________________

self = <tests.test_imapclient.TestIdleAndNoop testMethod=test_idle>

    def test_idle(self):
        self.client._imap._command.return_value = sentinel.tag
        self.client._imap._get_response.return_value = None
    
        self.client.idle()
    
>       self.client._imap._command.assert_called_with("IDLE")

tests/test_imapclient.py:557: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock._command' id='124007564905104'>, args = ('IDLE',)
kwargs = {}, expected = "_command('IDLE')", actual = 'not called.'
error_message = "expected call not found.\nExpected: _command('IDLE')\nActual: not called."

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
>           raise AssertionError(error_message)
E           AssertionError: expected call not found.
E           Expected: _command('IDLE')
E           Actual: not called.

/usr/lib/python3.10/unittest/mock.py:920: AssertionError
___________________ TestIdleAndNoop.test_idle_check_blocking ___________________

self = <tests.test_imapclient.TestIdleAndNoop testMethod=test_idle_check_blocking>
mock_select = <MagicMock name='select' id='124007564521440'>

    @patch("imapclient.imapclient.POLL_SUPPORT", False)
    @patch("imapclient.imapclient.select.select")
    def test_idle_check_blocking(self, mock_select):
        mock_sock = Mock()
        self.client._imap.sock = self.client._imap.sslobj = mock_sock
        mock_select.return_value = ([True], [], [])
        counter = itertools.count()
    
        def fake_get_line():
            count = next(counter)
            if count == 0:
                return b"* 1 EXISTS"
            elif count == 1:
                return b"* 0 EXPUNGE"
            else:
                raise socket.timeout
    
        self.client._imap._get_line = fake_get_line
    
        responses = self.client.idle_check()
    
>       mock_select.assert_called_once_with([mock_sock], [], [], None)

tests/test_imapclient.py:581: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='select' id='124007564521440'>
args = ([<Mock name='mock.sock' id='124007564517408'>], [], [], None)
kwargs = {}, msg = "Expected 'select' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'select' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
________________ TestIdleAndNoop.test_idle_check_blocking_poll _________________

self = <tests.test_imapclient.TestIdleAndNoop testMethod=test_idle_check_blocking_poll>
mock_poll_module = <MagicMock name='poll' id='124007569650544'>

    @patch("imapclient.imapclient.POLL_SUPPORT", True)
    @patch("imapclient.imapclient.select.poll")
    def test_idle_check_blocking_poll(self, mock_poll_module):
        mock_sock = Mock(fileno=Mock(return_value=1))
        self.client._imap.sock = self.client._imap.sslobj = mock_sock
    
        mock_poller = Mock(poll=Mock(return_value=[(1, POLLIN)]))
        mock_poll_module.return_value = mock_poller
        counter = itertools.count()
    
        def fake_get_line():
            count = next(counter)
            if count == 0:
                return b"* 1 EXISTS"
            elif count == 1:
                return b"* 0 EXPUNGE"
            else:
                raise socket.timeout
    
        self.client._imap._get_line = fake_get_line
    
        responses = self.client.idle_check()
    
>       assert mock_poll_module.call_count == 1
E       AssertionError: assert 0 == 1
E        +  where 0 = <MagicMock name='poll' id='124007569650544'>.call_count

tests/test_imapclient.py:644: AssertionError
___________________ TestIdleAndNoop.test_idle_check_timeout ____________________

self = <tests.test_imapclient.TestIdleAndNoop testMethod=test_idle_check_timeout>
mock_select = <MagicMock name='select' id='124007566008496'>

    @patch("imapclient.imapclient.POLL_SUPPORT", False)
    @patch("imapclient.imapclient.select.select")
    def test_idle_check_timeout(self, mock_select):
        mock_sock = Mock()
        self.client._imap.sock = self.client._imap.sslobj = mock_sock
        mock_select.return_value = ([], [], [])
    
        responses = self.client.idle_check(timeout=0.5)
    
>       mock_select.assert_called_once_with([mock_sock], [], [], 0.5)

tests/test_imapclient.py:594: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='select' id='124007566008496'>
args = ([<Mock name='mock.sock' id='124007566006240'>], [], [], 0.5)
kwargs = {}, msg = "Expected 'select' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'select' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
_________________ TestIdleAndNoop.test_idle_check_timeout_poll _________________

self = <tests.test_imapclient.TestIdleAndNoop testMethod=test_idle_check_timeout_poll>
mock_poll_module = <MagicMock name='poll' id='124007564636656'>

    @patch("imapclient.imapclient.POLL_SUPPORT", True)
    @patch("imapclient.imapclient.select.poll")
    def test_idle_check_timeout_poll(self, mock_poll_module):
        mock_sock = Mock(fileno=Mock(return_value=1))
        self.client._imap.sock = self.client._imap.sslobj = mock_sock
    
        mock_poller = Mock(poll=Mock(return_value=[]))
        mock_poll_module.return_value = mock_poller
    
        responses = self.client.idle_check(timeout=0.5)
    
>       assert mock_poll_module.call_count == 1
E       AssertionError: assert 0 == 1
E        +  where 0 = <MagicMock name='poll' id='124007564636656'>.call_count

tests/test_imapclient.py:661: AssertionError
__________________ TestIdleAndNoop.test_idle_check_with_data ___________________

self = <tests.test_imapclient.TestIdleAndNoop testMethod=test_idle_check_with_data>
mock_select = <MagicMock name='select' id='124007565626768'>

    @patch("imapclient.imapclient.POLL_SUPPORT", False)
    @patch("imapclient.imapclient.select.select")
    def test_idle_check_with_data(self, mock_select):
        mock_sock = Mock()
        self.client._imap.sock = self.client._imap.sslobj = mock_sock
        mock_select.return_value = ([True], [], [])
        counter = itertools.count()
    
        def fake_get_line():
            count = next(counter)
            if count == 0:
                return b"* 99 EXISTS"
            else:
                raise socket.timeout
    
        self.client._imap._get_line = fake_get_line
    
        responses = self.client.idle_check()
    
>       mock_select.assert_called_once_with([mock_sock], [], [], None)

tests/test_imapclient.py:617: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='select' id='124007565626768'>
args = ([<Mock name='mock.sock' id='124007565633440'>], [], [], None)
kwargs = {}, msg = "Expected 'select' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'select' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
________________ TestIdleAndNoop.test_idle_check_with_data_poll ________________

self = <tests.test_imapclient.TestIdleAndNoop testMethod=test_idle_check_with_data_poll>
mock_poll_module = <MagicMock name='poll' id='124007564498672'>

    @patch("imapclient.imapclient.POLL_SUPPORT", True)
    @patch("imapclient.imapclient.select.poll")
    def test_idle_check_with_data_poll(self, mock_poll_module):
        mock_sock = Mock(fileno=Mock(return_value=1))
        self.client._imap.sock = self.client._imap.sslobj = mock_sock
    
        mock_poller = Mock(poll=Mock(return_value=[(1, POLLIN)]))
        mock_poll_module.return_value = mock_poller
        counter = itertools.count()
    
        def fake_get_line():
            count = next(counter)
            if count == 0:
                return b"* 99 EXISTS"
            else:
                raise socket.timeout
    
        self.client._imap._get_line = fake_get_line
    
        responses = self.client.idle_check()
    
>       assert mock_poll_module.call_count == 1
E       AssertionError: assert 0 == 1
E        +  where 0 = <MagicMock name='poll' id='124007564498672'>.call_count

tests/test_imapclient.py:688: AssertionError
________________________ TestIdleAndNoop.test_idle_done ________________________

self = <tests.test_imapclient.TestIdleAndNoop testMethod=test_idle_done>

    def test_idle_done(self):
        self.client._idle_tag = sentinel.tag
    
        mockSend = Mock()
        self.client._imap.send = mockSend
        mockConsume = Mock(return_value=sentinel.out)
        self.client._consume_until_tagged_response = mockConsume
    
        result = self.client.idle_done()
    
>       mockSend.assert_called_with(b"DONE\r\n")

tests/test_imapclient.py:704: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock name='mock.send' id='124007563291392'>, args = (b'DONE\r\n',)
kwargs = {}, expected = "send(b'DONE\\r\\n')", actual = 'not called.'
error_message = "expected call not found.\nExpected: send(b'DONE\\r\\n')\nActual: not called."

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
>           raise AssertionError(error_message)
E           AssertionError: expected call not found.
E           Expected: send(b'DONE\r\n')
E           Actual: not called.

/usr/lib/python3.10/unittest/mock.py:920: AssertionError
__________________________ TestIdleAndNoop.test_noop ___________________________

self = <tests.test_imapclient.TestIdleAndNoop testMethod=test_noop>

    def test_noop(self):
        mockCommand = Mock(return_value=sentinel.tag)
        self.client._imap._command = mockCommand
        mockConsume = Mock(return_value=sentinel.out)
        self.client._consume_until_tagged_response = mockConsume
    
        result = self.client.noop()
    
>       mockCommand.assert_called_with("NOOP")

tests/test_imapclient.py:716: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock name='mock._command' id='124007564451440'>, args = ('NOOP',)
kwargs = {}, expected = "_command('NOOP')", actual = 'not called.'
error_message = "expected call not found.\nExpected: _command('NOOP')\nActual: not called."

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
>           raise AssertionError(error_message)
E           AssertionError: expected call not found.
E           Expected: _command('NOOP')
E           Actual: not called.

/usr/lib/python3.10/unittest/mock.py:920: AssertionError
___________________ TestDebugLogging.test_redacted_password ____________________

self = <tests.test_imapclient.TestDebugLogging testMethod=test_redacted_password>

    def test_redacted_password(self):
        logger_mock = Mock()
        logger_mock.manager.disable = logging.DEBUG
        logger_mock.getEffectiveLevel.return_value = logging.DEBUG
    
        adapter = IMAPlibLoggerAdapter(logger_mock, dict())
        adapter.info("""> b'ICHH1 LOGIN foo@bar.org "secret"'""")
        if sys.version_info >= (3, 6, 4):
            # LoggerAdapter in Python 3.6.4+ calls logger.log()
>           logger_mock.log.assert_called_once_with(
                logging.INFO, "> b'ICHH1 LOGIN **REDACTED**", extra={}
            )

tests/test_imapclient.py:761: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/unittest/mock.py:941: in assert_called_once_with
    return self.assert_called_with(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock name='mock.log' id='124007566002544'>
args = (20, "> b'ICHH1 LOGIN **REDACTED**"), kwargs = {'extra': {}}
expected = call(20, "> b'ICHH1 LOGIN **REDACTED**", extra={})
actual = call(20, '> b\'ICHH1 LOGIN foo@bar.org "secret"\'', extra={})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x70c8c2eeae60>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: log(20, "> b'ICHH1 LOGIN **REDACTED**", extra={})
E           Actual: log(20, '> b\'ICHH1 LOGIN foo@bar.org "secret"\'', extra={})

/usr/lib/python3.10/unittest/mock.py:929: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________ TestTimeNormalisation.test_pass_through ____________________

self = <tests.test_imapclient.TestTimeNormalisation testMethod=test_pass_through>
parse_fetch_response = <MagicMock name='parse_fetch_response' id='124007564343424'>

    @patch("imapclient.imapclient.parse_fetch_response")
    def test_pass_through(self, parse_fetch_response):
        self.client._imap._command_complete.return_value = ("OK", sentinel.data)
        self.client._imap._untagged_response.return_value = ("OK", sentinel.fetch_data)
        self.client.use_uid = sentinel.use_uid
    
        def check(expected):
            self.client.fetch(22, ["SOMETHING"])
            parse_fetch_response.assert_called_with(
                sentinel.fetch_data, expected, sentinel.use_uid
            )
    
        self.client.normalise_times = True
>       check(True)

tests/test_imapclient.py:788: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_imapclient.py:783: in check
    parse_fetch_response.assert_called_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='parse_fetch_response' id='124007564343424'>
args = (sentinel.fetch_data, True, sentinel.use_uid), kwargs = {}
expected = 'parse_fetch_response(sentinel.fetch_data, True, sentinel.use_uid)'
actual = 'not called.'
error_message = 'expected call not found.\nExpected: parse_fetch_response(sentinel.fetch_data, True, sentinel.use_uid)\nActual: not called.'

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
>           raise AssertionError(error_message)
E           AssertionError: expected call not found.
E           Expected: parse_fetch_response(sentinel.fetch_data, True, sentinel.use_uid)
E           Actual: not called.

/usr/lib/python3.10/unittest/mock.py:920: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
__________________________ TestNamespace.test_complex __________________________

self = <tests.test_imapclient.TestNamespace testMethod=test_complex>

    def test_complex(self):
        self.set_return(
            b'(("" "/")) '
            b'(("~" "/")) '
            b'(("#shared/" "/") ("#public/" "/")("#ftp/" "/")("#news." "."))'
        )
>       self.assertEqual(
            self.client.namespace(),
            (
                (("", "/"),),
                (("~", "/"),),
                (("#shared/", "/"), ("#public/", "/"), ("#ftp/", "/"), ("#news.", ".")),
            ),
        )
E       AssertionError: None != ((('', '/'),), (('~', '/'),), (('#shared/[56 chars].')))

tests/test_imapclient.py:825: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
______________________ TestNamespace.test_folder_decoding ______________________

self = <tests.test_imapclient.TestNamespace testMethod=test_folder_decoding>

    def test_folder_decoding(self):
        self.set_return(b'(("&AP8-." "/")) NIL NIL')
>       self.assertEqual(self.client.namespace(), ((("\xff.", "/"),), None, None))
E       AssertionError: None != ((('ÿ.', '/'),), None, None)

tests/test_imapclient.py:808: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
________________________ TestNamespace.test_other_only _________________________

self = <tests.test_imapclient.TestNamespace testMethod=test_other_only>

    def test_other_only(self):
        self.set_return(b'NIL NIL (("" "."))')
>       self.assertEqual(self.client.namespace(), (None, None, (("", "."),)))
E       AssertionError: None != (None, None, (('', '.'),))

tests/test_imapclient.py:817: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
__________________________ TestNamespace.test_simple ___________________________

self = <tests.test_imapclient.TestNamespace testMethod=test_simple>

    def test_simple(self):
        self.set_return(b'(("FOO." "/")) NIL NIL')
>       self.assertEqual(self.client.namespace(), ((("FOO.", "/"),), None, None))
E       AssertionError: None != ((('FOO.', '/'),), None, None)

tests/test_imapclient.py:804: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
__________________ TestNamespace.test_without_folder_decoding __________________

self = <tests.test_imapclient.TestNamespace testMethod=test_without_folder_decoding>

    def test_without_folder_decoding(self):
        self.set_return(b'(("&AP8-." "/")) NIL NIL')
        self.client.folder_encode = False
>       self.assertEqual(self.client.namespace(), (((b"&AP8-.", "/"),), None, None))
E       AssertionError: None != (((b'&AP8-.', '/'),), None, None)

tests/test_imapclient.py:813: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
________________________ TestCapabilities.test_caching _________________________

self = <tests.test_imapclient.TestCapabilities testMethod=test_caching>

    def test_caching(self):
        self.client._imap.capabilities = ("FOO",)
        self.client._imap.untagged_responses = {}
        self.client._cached_capabilities = (b"FOO", b"MORE")
    
>       self.assertEqual(self.client.capabilities(), (b"FOO", b"MORE"))
E       AssertionError: None != (b'FOO', b'MORE')

tests/test_imapclient.py:856: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________ TestCapabilities.test_post_auth_request ____________________

self = <tests.test_imapclient.TestCapabilities testMethod=test_post_auth_request>

    def test_post_auth_request(self):
        self.client._imap.capabilities = ("FOO",)
        self.client._imap.untagged_responses = {}
        self.client._imap.state = "SELECTED"
        self.client._imap.capability.return_value = ("OK", [b"FOO BAR"])
    
>       self.assertEqual(self.client.capabilities(), (b"FOO", b"BAR"))
E       AssertionError: None != (b'FOO', b'BAR')

tests/test_imapclient.py:864: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
________________________ TestCapabilities.test_preauth _________________________

self = <tests.test_imapclient.TestCapabilities testMethod=test_preauth>

    def test_preauth(self):
        self.client._imap.capabilities = ("FOO", "BAR")
        self.client._imap.untagged_responses = {}
    
>       self.assertEqual(self.client.capabilities(), (b"FOO", b"BAR"))
E       AssertionError: None != (b'FOO', b'BAR')

tests/test_imapclient.py:840: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_________ TestCapabilities.test_server_returned_capability_after_auth __________

self = <tests.test_imapclient.TestCapabilities testMethod=test_server_returned_capability_after_auth>

    def test_server_returned_capability_after_auth(self):
        self.client._imap.capabilities = (b"FOO",)
        self.client._imap.untagged_responses = {"CAPABILITY": [b"FOO MORE"]}
    
        self.assertEqual(self.client._cached_capabilities, None)
>       self.assertEqual(self.client.capabilities(), (b"FOO", b"MORE"))
E       AssertionError: None != (b'FOO', b'MORE')

tests/test_imapclient.py:847: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_____________________ TestCapabilities.test_with_starttls ______________________

self = <tests.test_imapclient.TestCapabilities testMethod=test_with_starttls>

    def test_with_starttls(self):
        # Initial connection
        self.client._imap.capabilities = ("FOO",)
        self.client._imap.untagged_responses = {}
        self.client._imap.state = "NONAUTH"
>       self.assertEqual(self.client.capabilities(), (b"FOO",))
E       AssertionError: None != (b'FOO',)

tests/test_imapclient.py:872: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
________________________________ TestId.test_id ________________________________

self = <tests.test_imapclient.TestId testMethod=test_id>

    def test_id(self):
        self.client._imap._simple_command.return_value = ("OK", [b"Success"])
        self.client._imap._untagged_response.return_value = (
            b"OK",
            [b'("name" "GImap" "vendor" "Google, Inc.")'],
        )
    
        id_response = self.client.id_({"name": "IMAPClient"})
>       self.client._imap._simple_command.assert_called_with(
            "ID", '("name" "IMAPClient")'
        )

tests/test_imapclient.py:928: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock._simple_command' id='124007563256752'>
args = ('ID', '("name" "IMAPClient")'), kwargs = {}
expected = '_simple_command(\'ID\', \'("name" "IMAPClient")\')'
actual = 'not called.'
error_message = 'expected call not found.\nExpected: _simple_command(\'ID\', \'("name" "IMAPClient")\')\nActual: not called.'

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
>           raise AssertionError(error_message)
E           AssertionError: expected call not found.
E           Expected: _simple_command('ID', '("name" "IMAPClient")')
E           Actual: not called.

/usr/lib/python3.10/unittest/mock.py:920: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
________________________ TestId.test_invalid_parameters ________________________

self = <tests.test_imapclient.TestId testMethod=test_invalid_parameters>

    def test_invalid_parameters(self):
>       self.assertRaises(TypeError, self.client.id_, "bananarama")
E       AssertionError: TypeError not raised by id_

tests/test_imapclient.py:941: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_________________________ TestRawCommand.test_complex __________________________

self = <tests.test_imapclient.TestRawCommand testMethod=test_complex>

    def test_complex(self):
>       self.check(
            b"search",
            [b"FLAGGED", b"TEXT", b"\xfe\xff", b"TEXT", b"\xcc", b"TEXT", b"foo"],
            b"tag UID SEARCH FLAGGED TEXT {2}\r\n"
            b"\xfe\xff TEXT {1}\r\n"
            b"\xcc TEXT foo\r\n",
        )

tests/test_imapclient.py:1026: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.test_imapclient.TestRawCommand testMethod=test_complex>
command = b'search'
args = [b'FLAGGED', b'TEXT', b'\xfe\xff', b'TEXT', b'\xcc', b'TEXT', ...]
expected = b'tag UID SEARCH FLAGGED TEXT {2}\r\n\xfe\xff TEXT {1}\r\n\xcc TEXT foo\r\n'

    def check(self, command, args, expected):
>       typ, data = self.client._raw_command(command, args)
E       TypeError: cannot unpack non-iterable NoneType object

tests/test_imapclient.py:952: TypeError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_____________________ TestRawCommand.test_embedded_literal _____________________

self = <tests.test_imapclient.TestRawCommand testMethod=test_embedded_literal>

    def test_embedded_literal(self):
>       self.check(
            b"search",
            [b"TEXT", b"\xfe\xff", b"DELETED"],
            b"tag UID SEARCH TEXT {2}\r\n" b"\xfe\xff DELETED\r\n",
        )

tests/test_imapclient.py:980: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.test_imapclient.TestRawCommand testMethod=test_embedded_literal>
command = b'search', args = [b'TEXT', b'\xfe\xff', b'DELETED']
expected = b'tag UID SEARCH TEXT {2}\r\n\xfe\xff DELETED\r\n'

    def check(self, command, args, expected):
>       typ, data = self.client._raw_command(command, args)
E       TypeError: cannot unpack non-iterable NoneType object

tests/test_imapclient.py:952: TypeError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_________________ TestRawCommand.test_failed_continuation_wait _________________

self = <tests.test_imapclient.TestRawCommand testMethod=test_failed_continuation_wait>

    def test_failed_continuation_wait(self):
        self.client._imap._get_response.return_value = b"blah"
        self.client._imap.tagged_commands["tag"] = ("NO", ["go away"])
    
        expected_error = r"unexpected response while waiting for continuation response: \(u?'NO', \[u?'go away'\]\)"
>       with self.assertRaisesRegex(IMAPClient.AbortError, expected_error):
E       AssertionError: abort not raised

tests/test_imapclient.py:1043: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
____________________ TestRawCommand.test_invalid_input_type ____________________

self = <tests.test_imapclient.TestRawCommand testMethod=test_invalid_input_type>

    def test_invalid_input_type(self):
>       self.assertRaises(ValueError, self.client._raw_command, "foo", [])
E       AssertionError: ValueError not raised by _raw_command

tests/test_imapclient.py:1035: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
______________________ TestRawCommand.test_literal_at_end ______________________

self = <tests.test_imapclient.TestRawCommand testMethod=test_literal_at_end>

    def test_literal_at_end(self):
>       self.check(
            b"search",
            [b"TEXT", b"\xfe\xff"],
            b"tag UID SEARCH TEXT {2}\r\n" b"\xfe\xff\r\n",
        )

tests/test_imapclient.py:973: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.test_imapclient.TestRawCommand testMethod=test_literal_at_end>
command = b'search', args = [b'TEXT', b'\xfe\xff']
expected = b'tag UID SEARCH TEXT {2}\r\n\xfe\xff\r\n'

    def check(self, command, args, expected):
>       typ, data = self.client._raw_command(command, args)
E       TypeError: cannot unpack non-iterable NoneType object

tests/test_imapclient.py:952: TypeError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_______________________ TestRawCommand.test_literal_plus _______________________

self = <tests.test_imapclient.TestRawCommand testMethod=test_literal_plus>

    def test_literal_plus(self):
        self.client._cached_capabilities = (b"LITERAL+",)
    
>       typ, data = self.client._raw_command(
            b"APPEND", [b"\xff", _literal(b"hello")], uid=False
        )
E       TypeError: cannot unpack non-iterable NoneType object

tests/test_imapclient.py:996: TypeError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
______________ TestRawCommand.test_literal_plus_multiple_literals ______________

self = <tests.test_imapclient.TestRawCommand testMethod=test_literal_plus_multiple_literals>

    def test_literal_plus_multiple_literals(self):
        self.client._cached_capabilities = (b"LITERAL+",)
    
>       typ, data = self.client._raw_command(
            b"APPEND",
            [b"\xff", _literal(b"hello"), b"TEXT", _literal(b"test")],
            uid=False,
        )
E       TypeError: cannot unpack non-iterable NoneType object

tests/test_imapclient.py:1009: TypeError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
____________________ TestRawCommand.test_multiple_literals _____________________

self = <tests.test_imapclient.TestRawCommand testMethod=test_multiple_literals>

    def test_multiple_literals(self):
>       self.check(
            b"search",
            [b"TEXT", b"\xfe\xff", b"TEXT", b"\xcc"],
            b"tag UID SEARCH TEXT {2}\r\n" b"\xfe\xff TEXT {1}\r\n" b"\xcc\r\n",
        )

tests/test_imapclient.py:987: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.test_imapclient.TestRawCommand testMethod=test_multiple_literals>
command = b'search', args = [b'TEXT', b'\xfe\xff', b'TEXT', b'\xcc']
expected = b'tag UID SEARCH TEXT {2}\r\n\xfe\xff TEXT {1}\r\n\xcc\r\n'

    def check(self, command, args, expected):
>       typ, data = self.client._raw_command(command, args)
E       TypeError: cannot unpack non-iterable NoneType object

tests/test_imapclient.py:952: TypeError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_________________________ TestRawCommand.test_not_uid __________________________

self = <tests.test_imapclient.TestRawCommand testMethod=test_not_uid>

    def test_not_uid(self):
        self.client.use_uid = False
>       self.check(
            b"search",
            [b"ALL"],
            b"tag SEARCH ALL\r\n",
        )

tests/test_imapclient.py:966: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.test_imapclient.TestRawCommand testMethod=test_not_uid>
command = b'search', args = [b'ALL'], expected = b'tag SEARCH ALL\r\n'

    def check(self, command, args, expected):
>       typ, data = self.client._raw_command(command, args)
E       TypeError: cannot unpack non-iterable NoneType object

tests/test_imapclient.py:952: TypeError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
__________________________ TestRawCommand.test_plain ___________________________

self = <tests.test_imapclient.TestRawCommand testMethod=test_plain>

    def test_plain(self):
>       self.check(
            b"search",
            [b"ALL"],
            b"tag UID SEARCH ALL\r\n",
        )

tests/test_imapclient.py:958: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.test_imapclient.TestRawCommand testMethod=test_plain>
command = b'search', args = [b'ALL'], expected = b'tag UID SEARCH ALL\r\n'

    def check(self, command, args, expected):
>       typ, data = self.client._raw_command(command, args)
E       TypeError: cannot unpack non-iterable NoneType object

tests/test_imapclient.py:952: TypeError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________________ TestExpunge.test_expunge ___________________________

self = <tests.test_imapclient.TestExpunge testMethod=test_expunge>

    def test_expunge(self):
        mockCommand = Mock(return_value=sentinel.tag)
        mockConsume = Mock(return_value=sentinel.out)
        self.client._imap._command = mockCommand
        self.client._consume_until_tagged_response = mockConsume
        result = self.client.expunge()
>       mockCommand.assert_called_with("EXPUNGE")

tests/test_imapclient.py:1054: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock name='mock._command' id='124007564760480'>, args = ('EXPUNGE',)
kwargs = {}, expected = "_command('EXPUNGE')", actual = 'not called.'
error_message = "expected call not found.\nExpected: _command('EXPUNGE')\nActual: not called."

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
>           raise AssertionError(error_message)
E           AssertionError: expected call not found.
E           Expected: _command('EXPUNGE')
E           Actual: not called.

/usr/lib/python3.10/unittest/mock.py:920: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_________________________ TestExpunge.test_id_expunge __________________________

self = <tests.test_imapclient.TestExpunge testMethod=test_id_expunge>

    def test_id_expunge(self):
        self.client._imap.uid.return_value = ("OK", [None])
>       self.assertEqual([None], self.client.expunge(["4", "5", "6"]))
E       AssertionError: [None] != None

tests/test_imapclient.py:1060: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
__________________________ TestShutdown.test_shutdown __________________________

self = <tests.test_imapclient.TestShutdown testMethod=test_shutdown>

    def test_shutdown(self):
        self.client.shutdown()
>       self.client._imap.shutdown.assert_called_once_with()

tests/test_imapclient.py:1066: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock.shutdown' id='124007564344144'>, args = ()
kwargs = {}, msg = "Expected 'shutdown' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'shutdown' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________ TestContextManager.test_context_manager ____________________

self = <tests.test_imapclient.TestContextManager testMethod=test_context_manager>

    def test_context_manager(self):
        with self.client as client:
            self.assertIsInstance(client, IMAPClient)
    
>       self.client._imap.logout.assert_called_once_with()

tests/test_imapclient.py:1074: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock.logout' id='124007565635744'>, args = ()
kwargs = {}, msg = "Expected 'logout' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'logout' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_____________ TestContextManager.test_context_manager_fail_closing _____________

self = <tests.test_imapclient.TestContextManager testMethod=test_context_manager_fail_closing>
mock_logger = <MagicMock name='logger' id='124007564335312'>

    @patch("imapclient.imapclient.logger")
    def test_context_manager_fail_closing(self, mock_logger):
        self.client._imap.logout.side_effect = RuntimeError("Error logout")
        self.client._imap.shutdown.side_effect = RuntimeError("Error shutdown")
    
        with self.client as client:
            self.assertIsInstance(client, IMAPClient)
    
>       self.client._imap.logout.assert_called_once_with()

tests/test_imapclient.py:1084: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MockIMAP4 name='mock.logout' id='124007564334256'>, args = ()
kwargs = {}, msg = "Expected 'logout' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'logout' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________ TestProtocolError.test_tagged_response_with_parse_error ____________

self = <tests.test_imapclient.TestProtocolError testMethod=test_tagged_response_with_parse_error>

    def test_tagged_response_with_parse_error(self):
        client = self.client
        client._imap.tagged_commands = {sentinel.tag: None}
        client._imap._get_response = lambda: b"NOT-A-STAR 99 EXISTS"
    
        with self.assertRaises(ProtocolError):
>           client._consume_until_tagged_response(sentinel.tag, b"IDLE")
E           AttributeError: 'TestableIMAPClient' object has no attribute '_consume_until_tagged_response'

tests/test_imapclient.py:1104: AttributeError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_________ TestSocket.test_issues_warning_for_deprecating_sock_property _________

self = <tests.test_imapclient.TestSocket testMethod=test_issues_warning_for_deprecating_sock_property>

    def test_issues_warning_for_deprecating_sock_property(self):
        mock_sock = Mock()
        self.client._imap.sock = self.client._imap.sslobj = mock_sock
        with warnings.catch_warnings(record=True) as warnings_caught:
            warnings.simplefilter("always", DeprecationWarning)
>           assert self.client._sock == self.client.socket()
E           AttributeError: 'TestableIMAPClient' object has no attribute '_sock'

tests/test_imapclient.py:1113: AttributeError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
________________ TestTokenSource.test_unmatched_square_brackets ________________
ValueError: No closing '']'

During handling of the above exception, another exception occurred:

self = <tests.test_response_lexer.TestTokenSource testMethod=test_unmatched_square_brackets>

    def test_unmatched_square_brackets(self):
        message = "No closing ']'"
>       self.check_error([b"["], message)

tests/test_response_lexer.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_response_lexer.py:94: in check_error
    self.assertRaisesRegex(
E   AssertionError: "No closing ']'" does not match "No closing '']'"
________________________ TestSearch.test_bytes_criteria ________________________

self = <tests.test_search.TestSearch testMethod=test_bytes_criteria>

    def test_bytes_criteria(self):
        result = self.client.search([b"FOO", b"BAR"])
    
>       self.check_call([b"FOO", b"BAR"])

tests/test_search.py:31: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564457152'>, args = (b'SEARCH', [b'FOO', b'BAR'])
kwargs = {}, msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_________________ TestSearch.test_bytes_criteria_with_charset __________________

self = <tests.test_search.TestSearch testMethod=test_bytes_criteria_with_charset>

    def test_bytes_criteria_with_charset(self):
        self.client.search([b"FOO", b"BAR"], "utf-92")
    
>       self.check_call([b"CHARSET", b"utf-92", b"FOO", b"BAR"])

tests/test_search.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007566536384'>
args = (b'SEARCH', [b'CHARSET', b'utf-92', b'FOO', b'BAR']), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
____________________________ TestSearch.test_modseq ____________________________

self = <tests.test_search.TestSearch testMethod=test_modseq>

    def test_modseq(self):
        self.client._raw_command_untagged.return_value = [b"1 2 (MODSEQ 51101)"]
    
        result = self.client.search(["MODSEQ", "40000"])
    
>       self.check_call([b"MODSEQ", b"40000"])

tests/test_search.py:81: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564513184'>, args = (b'SEARCH', [b'MODSEQ', b'40000'])
kwargs = {}, msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
____________________________ TestSearch.test_nested ____________________________

self = <tests.test_search.TestSearch testMethod=test_nested>

    def test_nested(self):
        self.client.search(["NOT", ["SUBJECT", "topic", "TO", "some@email.com"]])
>       self.check_call([b"NOT", b"(SUBJECT", b"topic", b"TO", b"some@email.com)"])

tests/test_search.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007565185072'>
args = (b'SEARCH', [b'NOT', b'(SUBJECT', b'topic', b'TO', b'some@email.com)'])
kwargs = {}, msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_________________________ TestSearch.test_nested_empty _________________________

self = <tests.test_search.TestSearch testMethod=test_nested_empty>

    def test_nested_empty(self):
>       self.assertRaises(InvalidCriteriaError, self.client.search, [[]])
E       AssertionError: InvalidCriteriaError not raised by search

tests/test_search.py:86: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_______________________ TestSearch.test_nested_multiple ________________________

self = <tests.test_search.TestSearch testMethod=test_nested_multiple>

    def test_nested_multiple(self):
        self.client.search(["NOT", ["OR", ["A", "x", "B", "y"], ["C", "z"]]])
>       self.check_call([b"NOT", b"(OR", b"(A", b"x", b"B", b"y)", b"(C", b"z))"])

tests/test_search.py:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564522640'>
args = (b'SEARCH', [b'NOT', b'(OR', b'(A', b'x', b'B', b'y)', ...]), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_________________________ TestSearch.test_nested_tuple _________________________

self = <tests.test_search.TestSearch testMethod=test_nested_tuple>

    def test_nested_tuple(self):
        self.client.search(["NOT", ("SUBJECT", "topic", "TO", "some@email.com")])
>       self.check_call([b"NOT", b"(SUBJECT", b"topic", b"TO", b"some@email.com)"])

tests/test_search.py:102: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007566525728'>
args = (b'SEARCH', [b'NOT', b'(SUBJECT', b'topic', b'TO', b'some@email.com)'])
kwargs = {}, msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
__________________________ TestSearch.test_no_results __________________________

self = <tests.test_search.TestSearch testMethod=test_no_results>

    def test_no_results(self):
        self.client._raw_command_untagged.return_value = [None]
    
        result = self.client.search(["FOO"])
>       self.assertEqual(result, [])
E       AssertionError: None != []

tests/test_search.py:73: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________________ TestSearch.test_quoting ____________________________

self = <tests.test_search.TestSearch testMethod=test_quoting>

    def test_quoting(self):
        self.client.search(["TEXT", "foo bar"])
>       self.check_call([b"TEXT", _quoted(b'"foo bar"')])

tests/test_search.py:62: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007566877952'>, args = (b'SEARCH', [b'TEXT', b'"foo bar"'])
kwargs = {}, msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
__________ TestSearch.test_search_custom_exception_with_invalid_list ___________

self = <tests.test_search.TestSearch testMethod=test_search_custom_exception_with_invalid_list>

    def test_search_custom_exception_with_invalid_list(self):
        def search_bad_command_exp(*args, **kwargs):
            raise imaplib.IMAP4.error(
                'SEARCH command error: BAD ["Unknown argument NOT DELETED"]'
            )
    
        self.client._raw_command_untagged.side_effect = search_bad_command_exp
    
>       with self.assertRaises(imaplib.IMAP4.error) as cm:
E       AssertionError: error not raised

tests/test_search.py:112: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
__________ TestSearch.test_search_custom_exception_with_invalid_text ___________

self = <tests.test_search.TestSearch testMethod=test_search_custom_exception_with_invalid_text>

    def test_search_custom_exception_with_invalid_text(self):
        # Check the criteria is surrounding with quotes if the user is using a plain text criteria
        def search_bad_command_exp2(*args, **kwargs):
            raise imaplib.IMAP4.error(
                'SEARCH command error: BAD ["Unknown argument TOO"]'
            )
    
        self.client._raw_command_untagged.side_effect = search_bad_command_exp2
    
>       with self.assertRaises(imaplib.IMAP4.error) as cm:
E       AssertionError: error not raised

tests/test_search.py:133: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
____________________________ TestSearch.test_single ____________________________

self = <tests.test_search.TestSearch testMethod=test_single>

    def test_single(self):
        self.client.search([["FOO"]])
>       self.check_call([b"(FOO)"])

tests/test_search.py:90: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007569653664'>, args = (b'SEARCH', [b'(FOO)']), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_______________________ TestSearch.test_unicode_criteria _______________________

self = <tests.test_search.TestSearch testMethod=test_unicode_criteria>

    def test_unicode_criteria(self):
        result = self.client.search(["FOO", "BAR"])
    
        # Default conversion using us-ascii.
>       self.check_call([b"FOO", b"BAR"])

tests/test_search.py:44: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007563266368'>, args = (b'SEARCH', [b'FOO', b'BAR'])
kwargs = {}, msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
________________ TestSearch.test_unicode_criteria_with_charset _________________

self = <tests.test_search.TestSearch testMethod=test_unicode_criteria_with_charset>

    def test_unicode_criteria_with_charset(self):
        self.client.search(["FOO", "\u2639"], "utf-8")
>       self.check_call([b"CHARSET", b"utf-8", b"FOO", _quoted(b"\xe2\x98\xb9")])

tests/test_search.py:50: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007565194672'>
args = (b'SEARCH', [b'CHARSET', b'utf-8', b'FOO', b'\xe2\x98\xb9']), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
__________________________ TestSearch.test_with_date ___________________________

self = <tests.test_search.TestSearch testMethod=test_with_date>

    def test_with_date(self):
        self.client.search(["SINCE", date(2005, 4, 3)])
>       self.check_call([b"SINCE", b"03-Apr-2005"])

tests/test_search.py:54: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007565632720'>
args = (b'SEARCH', [b'SINCE', b'03-Apr-2005']), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
________________________ TestSearch.test_with_datetime _________________________

self = <tests.test_search.TestSearch testMethod=test_with_datetime>

    def test_with_datetime(self):
        self.client.search(["SINCE", datetime(2005, 4, 3, 2, 1, 0)])
>       self.check_call([b"SINCE", b"03-Apr-2005"])  # Time part is ignored

tests/test_search.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564447072'>
args = (b'SEARCH', [b'SINCE', b'03-Apr-2005']), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_____________________ TestSearch.test_zero_length_quoting ______________________

self = <tests.test_search.TestSearch testMethod=test_zero_length_quoting>

    def test_zero_length_quoting(self):
        # Zero-length strings should be quoted
        self.client.search(["HEADER", "List-Id", ""])
>       self.check_call([b"HEADER", b"List-Id", b'""'])

tests/test_search.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007563313264'>
args = (b'SEARCH', [b'HEADER', b'List-Id', b'""']), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_______________________ TestGmailSearch.test_bytes_query _______________________

self = <tests.test_search.TestGmailSearch testMethod=test_bytes_query>

    def test_bytes_query(self):
        result = self.client.gmail_search(b"foo bar")
    
>       self.check_call([b"CHARSET", b"UTF-8", b"X-GM-RAW", b'"foo bar"'])

tests/test_search.py:150: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007563264400'>
args = (b'SEARCH', [b'CHARSET', b'UTF-8', b'X-GM-RAW', b'"foo bar"'])
kwargs = {}, msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
________________ TestGmailSearch.test_bytes_query_with_charset _________________

self = <tests.test_search.TestGmailSearch testMethod=test_bytes_query_with_charset>

    def test_bytes_query_with_charset(self):
        result = self.client.gmail_search(b"foo bar", "utf-42")
    
>       self.check_call([b"CHARSET", b"utf-42", b"X-GM-RAW", b'"foo bar"'])

tests/test_search.py:156: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007566009552'>
args = (b'SEARCH', [b'CHARSET', b'utf-42', b'X-GM-RAW', b'"foo bar"'])
kwargs = {}, msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
______________ TestGmailSearch.test_unicode_criteria_with_charset ______________

self = <tests.test_search.TestGmailSearch testMethod=test_unicode_criteria_with_charset>

    def test_unicode_criteria_with_charset(self):
        self.client.gmail_search("foo \u2639", "utf-8")
    
>       self.check_call(
            [b"CHARSET", b"utf-8", b"X-GM-RAW", _quoted(b'"foo \xe2\x98\xb9"')]
        )

tests/test_search.py:162: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_search.py:22: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564766384'>
args = (b'SEARCH', [b'CHARSET', b'utf-8', b'X-GM-RAW', b'"foo \xe2\x98\xb9"'])
kwargs = {}, msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
____________________________ TestSort.test_all_args ____________________________

self = <tests.test_sort.TestSort testMethod=test_all_args>

    def test_all_args(self):
        self.client.sort("arrival", ["TEXT", "\u261e"], "UTF-7")
    
>       self.check_call([b"(ARRIVAL)", b"UTF-7", b"TEXT", b"+Jh4-"])

tests/test_sort.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sort.py:20: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007566005760'>
args = (b'SORT', [b'(ARRIVAL)', b'UTF-7', b'TEXT', b'+Jh4-'])
kwargs = {'unpack': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_______________________ TestSort.test_multiple_criteria ________________________

self = <tests.test_sort.TestSort testMethod=test_multiple_criteria>

    def test_multiple_criteria(self):
        self.client.sort(["arrival", b"SUBJECT"])
    
>       self.check_call([b"(ARRIVAL SUBJECT)", b"UTF-8", b"ALL"])

tests/test_sort.py:37: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sort.py:20: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564878912'>
args = (b'SORT', [b'(ARRIVAL SUBJECT)', b'UTF-8', b'ALL'])
kwargs = {'unpack': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
________________________ TestSort.test_single_criteria _________________________

self = <tests.test_sort.TestSort testMethod=test_single_criteria>

    def test_single_criteria(self):
        ids = self.client.sort("arrival")
    
>       self.check_call([b"(ARRIVAL)", b"UTF-8", b"ALL"])

tests/test_sort.py:31: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_sort.py:20: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007566532352'>
args = (b'SORT', [b'(ARRIVAL)', b'UTF-8', b'ALL']), kwargs = {'unpack': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_______________________ TestStarttls.test_command_fails ________________________

self = <tests.test_starttls.TestStarttls testMethod=test_command_fails>

    def test_command_fails(self):
        self.client._imap._simple_command.return_value = "NO", [b"sorry"]
    
>       with self.assertRaises(IMAPClientError) as raised:
E       AssertionError: error not raised

tests/test_starttls.py:50: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________ TestStarttls.test_fails_if_called_twice ____________________

self = <tests.test_starttls.TestStarttls testMethod=test_fails_if_called_twice>

    def test_fails_if_called_twice(self):
        self.client.starttls(sentinel.ssl_context)
>       self.assert_tls_already_established()

tests/test_starttls.py:56: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_starttls.py:63: in assert_tls_already_established
    with self.assertRaises(IMAPClient.AbortError) as raised:
E   AssertionError: abort not raised
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_____________________ TestStarttls.test_fails_if_ssl_true ______________________

self = <tests.test_starttls.TestStarttls testMethod=test_fails_if_ssl_true>

    def test_fails_if_ssl_true(self):
        self.client.ssl = True
>       self.assert_tls_already_established()

tests/test_starttls.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_starttls.py:63: in assert_tls_already_established
    with self.assertRaises(IMAPClient.AbortError) as raised:
E   AssertionError: abort not raised
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________________ TestStarttls.test_works ____________________________

self = <tests.test_starttls.TestStarttls testMethod=test_works>

    def test_works(self):
        resp = self.client.starttls(sentinel.ssl_context)
    
>       self.tls.wrap_socket.assert_called_once_with(
            sentinel.old_sock,
            sentinel.ssl_context,
            sentinel.host,
        )

tests/test_starttls.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='tls.wrap_socket' id='124007564762736'>
args = (sentinel.old_sock, sentinel.ssl_context, sentinel.host), kwargs = {}
msg = "Expected 'wrap_socket' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'wrap_socket' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
______________________________ TestFlags.test_add ______________________________

self = <tests.test_store.TestFlags testMethod=test_add>

    def test_add(self):
>       self.check(self.client.add_flags, b"+FLAGS")

tests/test_store.py:40: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_store.py:46: in check
    self._check(meth, expected_command)
tests/test_store.py:61: in _check
    cc.assert_called_once_with("store", b"1,2", expected_command, "(foo)", uid=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564513376'>, args = ('store', b'1,2', b'+FLAGS', '(foo)')
kwargs = {'uid': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
______________________________ TestFlags.test_get ______________________________

self = <tests.test_store.TestFlags testMethod=test_get>

    def test_get(self):
        with patch.object(
            self.client,
            "fetch",
            autospec=True,
            return_value={123: {b"FLAGS": [b"foo", b"bar"]}, 444: {b"FLAGS": [b"foo"]}},
        ):
            out = self.client.get_flags(sentinel.messages)
>           self.client.fetch.assert_called_with(sentinel.messages, ["FLAGS"])

tests/test_store.py:33: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/unittest/mock.py:205: in assert_called_with
    return mock.assert_called_with(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='fetch' spec='method' id='124007563256944'>
args = (sentinel.messages, ['FLAGS']), kwargs = {}
expected = "fetch(sentinel.messages, ['FLAGS'])", actual = 'not called.'
error_message = "expected call not found.\nExpected: fetch(sentinel.messages, ['FLAGS'])\nActual: not called."

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
>           raise AssertionError(error_message)
E           AssertionError: expected call not found.
E           Expected: fetch(sentinel.messages, ['FLAGS'])
E           Actual: not called.

/usr/lib/python3.10/unittest/mock.py:920: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
____________________________ TestFlags.test_remove _____________________________

self = <tests.test_store.TestFlags testMethod=test_remove>

    def test_remove(self):
>       self.check(self.client.remove_flags, b"-FLAGS")

tests/test_store.py:43: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_store.py:46: in check
    self._check(meth, expected_command)
tests/test_store.py:61: in _check
    cc.assert_called_once_with("store", b"1,2", expected_command, "(foo)", uid=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007566532736'>, args = ('store', b'1,2', b'-FLAGS', '(foo)')
kwargs = {'uid': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
______________________________ TestFlags.test_set ______________________________

self = <tests.test_store.TestFlags testMethod=test_set>

    def test_set(self):
>       self.check(self.client.set_flags, b"FLAGS")

tests/test_store.py:37: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_store.py:46: in check
    self._check(meth, expected_command)
tests/test_store.py:61: in _check
    cc.assert_called_once_with("store", b"1,2", expected_command, "(foo)", uid=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564625952'>, args = ('store', b'1,2', b'FLAGS', '(foo)')
kwargs = {'uid': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________________ TestGmailLabels.test_add ___________________________

self = <tests.test_store.TestGmailLabels testMethod=test_add>

    def test_add(self):
>       self.check(self.client.add_gmail_labels, b"+X-GM-LABELS")

tests/test_store.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_store.py:105: in check
    self._check(meth, expected_command)
tests/test_store.py:120: in _check
    cc.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007564755728'>
args = ('store', b'1,2', b'+X-GM-LABELS', '("f\\"o\\"o")')
kwargs = {'uid': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________________ TestGmailLabels.test_get ___________________________

self = <tests.test_store.TestGmailLabels testMethod=test_get>

    def test_get(self):
        with patch.object(
            self.client,
            "fetch",
            autospec=True,
            return_value={
                123: {b"X-GM-LABELS": [b"foo", b"&AUE-abel"]},
                444: {b"X-GM-LABELS": [b"foo"]},
            },
        ):
            out = self.client.get_gmail_labels(sentinel.messages)
>           self.client.fetch.assert_called_with(sentinel.messages, [b"X-GM-LABELS"])

tests/test_store.py:92: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/unittest/mock.py:205: in assert_called_with
    return mock.assert_called_with(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='fetch' spec='method' id='124007563260400'>
args = (sentinel.messages, [b'X-GM-LABELS']), kwargs = {}
expected = "fetch(sentinel.messages, [b'X-GM-LABELS'])", actual = 'not called.'
error_message = "expected call not found.\nExpected: fetch(sentinel.messages, [b'X-GM-LABELS'])\nActual: not called."

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
>           raise AssertionError(error_message)
E           AssertionError: expected call not found.
E           Expected: fetch(sentinel.messages, [b'X-GM-LABELS'])
E           Actual: not called.

/usr/lib/python3.10/unittest/mock.py:920: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
_________________________ TestGmailLabels.test_remove __________________________

self = <tests.test_store.TestGmailLabels testMethod=test_remove>

    def test_remove(self):
>       self.check(self.client.remove_gmail_labels, b"-X-GM-LABELS")

tests/test_store.py:102: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_store.py:105: in check
    self._check(meth, expected_command)
tests/test_store.py:120: in _check
    cc.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007569653088'>
args = ('store', b'1,2', b'-X-GM-LABELS', '("f\\"o\\"o")')
kwargs = {'uid': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________________ TestGmailLabels.test_set ___________________________

self = <tests.test_store.TestGmailLabels testMethod=test_set>

    def test_set(self):
>       self.check(self.client.set_gmail_labels, b"X-GM-LABELS")

tests/test_store.py:96: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_store.py:105: in check
    self._check(meth, expected_command)
tests/test_store.py:120: in _check
    cc.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007565126064'>
args = ('store', b'1,2', b'X-GM-LABELS', '("f\\"o\\"o")')
kwargs = {'uid': True}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________________ TestThread.test_all_args ___________________________

self = <tests.test_thread.TestThread testMethod=test_all_args>

    def test_all_args(self):
        self.client._cached_capabilities = (b"THREAD=COTTON",)
    
        self.client.thread("COTTON", ["TEXT", "\u261e"], "UTF-7")
    
>       self.check_call([b"COTTON", b"UTF-7", b"TEXT", b"+Jh4-"])

tests/test_thread.py:43: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_thread.py:20: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007566531248'>
args = (b'THREAD', [b'COTTON', b'UTF-7', b'TEXT', b'+Jh4-']), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
___________________________ TestThread.test_defaults ___________________________

self = <tests.test_thread.TestThread testMethod=test_defaults>

    def test_defaults(self):
        threads = self.client.thread()
    
>       self.check_call([b"REFERENCES", b"UTF-8", b"ALL"])

tests/test_thread.py:35: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_thread.py:20: in check_call
    self.client._raw_command_untagged.assert_called_once_with(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Mock id='124007563317488'>
args = (b'THREAD', [b'REFERENCES', b'UTF-8', b'ALL']), kwargs = {}
msg = "Expected 'mock' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'mock' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
______________________ TestThread.test_no_thread_support _______________________

self = <tests.test_thread.TestThread testMethod=test_no_thread_support>

    def test_no_thread_support(self):
        self.client._cached_capabilities = (b"NOT-THREAD",)
>       self.assertRaises(CapabilityError, self.client.thread)
E       AssertionError: CapabilityError not raised by thread

tests/test_thread.py:26: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
____________________ TestThread.test_unsupported_algorithm _____________________

self = <tests.test_thread.TestThread testMethod=test_unsupported_algorithm>

    def test_unsupported_algorithm(self):
        self.client._cached_capabilities = (b"THREAD=FOO",)
>       self.assertRaises(CapabilityError, self.client.thread)
E       AssertionError: CapabilityError not raised by thread

tests/test_thread.py:30: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG    imapclient.imapclient:imapclient.py:199 Connected to host somehost over SSL/TLS
--------------------------------- JSON report ----------------------------------
report saved to: report.json
=========================== short test summary info ============================
FAILED tests/test_auth.py::TestPlainLogin::test_fail - AssertionError: LoginE...
FAILED tests/test_auth.py::TestPlainLogin::test_simple - AssertionError: None...
FAILED tests/test_auth.py::TestPlainLogin::test_with_authorization_identity
FAILED tests/test_enable.py::TestEnable::test_failed1 - AssertionError: Expec...
FAILED tests/test_enable.py::TestEnable::test_failed2 - AssertionError: Expec...
FAILED tests/test_enable.py::TestEnable::test_multiple - AssertionError: Expe...
FAILED tests/test_enable.py::TestEnable::test_success - AssertionError: Expec...
FAILED tests/test_enable.py::TestEnable::test_wrong_state - AssertionError: I...
FAILED tests/test_folder_status.py::TestFolderStatus::test_basic - AssertionE...
FAILED tests/test_folder_status.py::TestFolderStatus::test_extra_response - A...
FAILED tests/test_folder_status.py::TestFolderStatus::test_literal - Assertio...
FAILED tests/test_imapclient.py::TestListFolders::test_blanks - AttributeErro...
FAILED tests/test_imapclient.py::TestListFolders::test_empty_response - Attri...
FAILED tests/test_imapclient.py::TestListFolders::test_folder_encode_off - As...
FAILED tests/test_imapclient.py::TestListFolders::test_funky_characters - Att...
FAILED tests/test_imapclient.py::TestListFolders::test_list_folders - Asserti...
FAILED tests/test_imapclient.py::TestListFolders::test_list_folders_NO - Asse...
FAILED tests/test_imapclient.py::TestListFolders::test_list_sub_folders - Ass...
FAILED tests/test_imapclient.py::TestListFolders::test_list_sub_folders_NO - ...
FAILED tests/test_imapclient.py::TestListFolders::test_mixed - AttributeError...
FAILED tests/test_imapclient.py::TestListFolders::test_quoted_specials - Attr...
FAILED tests/test_imapclient.py::TestListFolders::test_simple - AttributeErro...
FAILED tests/test_imapclient.py::TestListFolders::test_unquoted_numeric_folder_name
FAILED tests/test_imapclient.py::TestListFolders::test_unquoted_numeric_folder_name_parsed_as_long
FAILED tests/test_imapclient.py::TestListFolders::test_utf7_decoding - Assert...
FAILED tests/test_imapclient.py::TestListFolders::test_without_quotes - Attri...
FAILED tests/test_imapclient.py::TestFindSpecialFolder::test_find_special_folder_with_special_use
FAILED tests/test_imapclient.py::TestFindSpecialFolder::test_find_special_folder_with_special_use_single_flag
FAILED tests/test_imapclient.py::TestFindSpecialFolder::test_find_special_folder_without_special_use_nor_namespace
FAILED tests/test_imapclient.py::TestSelectFolder::test_normal - AssertionErr...
FAILED tests/test_imapclient.py::TestSelectFolder::test_unselect - AssertionE...
FAILED tests/test_imapclient.py::TestAppend::test_multiappend - AssertionErro...
FAILED tests/test_imapclient.py::TestAppend::test_multiappend_with_flags_and_internaldate
FAILED tests/test_imapclient.py::TestAppend::test_with_msg_time - AssertionEr...
FAILED tests/test_imapclient.py::TestAppend::test_without_msg_time - Assertio...
FAILED tests/test_imapclient.py::TestAclMethods::test_getacl - AssertionError...
FAILED tests/test_imapclient.py::TestAclMethods::test_setacl - AssertionError...
FAILED tests/test_imapclient.py::TestQuota::test__get_quota - AssertionError:...
FAILED tests/test_imapclient.py::TestQuota::test_get_quota_root - AssertionEr...
FAILED tests/test_imapclient.py::TestQuota::test_parse_quota - AssertionError...
FAILED tests/test_imapclient.py::TestQuota::test_set_quota - AssertionError: ...
FAILED tests/test_imapclient.py::TestIdleAndNoop::test_consume_until_tagged_response
FAILED tests/test_imapclient.py::TestIdleAndNoop::test_idle - AssertionError:...
FAILED tests/test_imapclient.py::TestIdleAndNoop::test_idle_check_blocking - ...
FAILED tests/test_imapclient.py::TestIdleAndNoop::test_idle_check_blocking_poll
FAILED tests/test_imapclient.py::TestIdleAndNoop::test_idle_check_timeout - A...
FAILED tests/test_imapclient.py::TestIdleAndNoop::test_idle_check_timeout_poll
FAILED tests/test_imapclient.py::TestIdleAndNoop::test_idle_check_with_data
FAILED tests/test_imapclient.py::TestIdleAndNoop::test_idle_check_with_data_poll
FAILED tests/test_imapclient.py::TestIdleAndNoop::test_idle_done - AssertionE...
FAILED tests/test_imapclient.py::TestIdleAndNoop::test_noop - AssertionError:...
FAILED tests/test_imapclient.py::TestDebugLogging::test_redacted_password - A...
FAILED tests/test_imapclient.py::TestTimeNormalisation::test_pass_through - A...
FAILED tests/test_imapclient.py::TestNamespace::test_complex - AssertionError...
FAILED tests/test_imapclient.py::TestNamespace::test_folder_decoding - Assert...
FAILED tests/test_imapclient.py::TestNamespace::test_other_only - AssertionEr...
FAILED tests/test_imapclient.py::TestNamespace::test_simple - AssertionError:...
FAILED tests/test_imapclient.py::TestNamespace::test_without_folder_decoding
FAILED tests/test_imapclient.py::TestCapabilities::test_caching - AssertionEr...
FAILED tests/test_imapclient.py::TestCapabilities::test_post_auth_request - A...
FAILED tests/test_imapclient.py::TestCapabilities::test_preauth - AssertionEr...
FAILED tests/test_imapclient.py::TestCapabilities::test_server_returned_capability_after_auth
FAILED tests/test_imapclient.py::TestCapabilities::test_with_starttls - Asser...
FAILED tests/test_imapclient.py::TestId::test_id - AssertionError: expected c...
FAILED tests/test_imapclient.py::TestId::test_invalid_parameters - AssertionE...
FAILED tests/test_imapclient.py::TestRawCommand::test_complex - TypeError: ca...
FAILED tests/test_imapclient.py::TestRawCommand::test_embedded_literal - Type...
FAILED tests/test_imapclient.py::TestRawCommand::test_failed_continuation_wait
FAILED tests/test_imapclient.py::TestRawCommand::test_invalid_input_type - As...
FAILED tests/test_imapclient.py::TestRawCommand::test_literal_at_end - TypeEr...
FAILED tests/test_imapclient.py::TestRawCommand::test_literal_plus - TypeErro...
FAILED tests/test_imapclient.py::TestRawCommand::test_literal_plus_multiple_literals
FAILED tests/test_imapclient.py::TestRawCommand::test_multiple_literals - Typ...
FAILED tests/test_imapclient.py::TestRawCommand::test_not_uid - TypeError: ca...
FAILED tests/test_imapclient.py::TestRawCommand::test_plain - TypeError: cann...
FAILED tests/test_imapclient.py::TestExpunge::test_expunge - AssertionError: ...
FAILED tests/test_imapclient.py::TestExpunge::test_id_expunge - AssertionErro...
FAILED tests/test_imapclient.py::TestShutdown::test_shutdown - AssertionError...
FAILED tests/test_imapclient.py::TestContextManager::test_context_manager - A...
FAILED tests/test_imapclient.py::TestContextManager::test_context_manager_fail_closing
FAILED tests/test_imapclient.py::TestProtocolError::test_tagged_response_with_parse_error
FAILED tests/test_imapclient.py::TestSocket::test_issues_warning_for_deprecating_sock_property
FAILED tests/test_response_lexer.py::TestTokenSource::test_unmatched_square_brackets
FAILED tests/test_search.py::TestSearch::test_bytes_criteria - AssertionError...
FAILED tests/test_search.py::TestSearch::test_bytes_criteria_with_charset - A...
FAILED tests/test_search.py::TestSearch::test_modseq - AssertionError: Expect...
FAILED tests/test_search.py::TestSearch::test_nested - AssertionError: Expect...
FAILED tests/test_search.py::TestSearch::test_nested_empty - AssertionError: ...
FAILED tests/test_search.py::TestSearch::test_nested_multiple - AssertionErro...
FAILED tests/test_search.py::TestSearch::test_nested_tuple - AssertionError: ...
FAILED tests/test_search.py::TestSearch::test_no_results - AssertionError: No...
FAILED tests/test_search.py::TestSearch::test_quoting - AssertionError: Expec...
FAILED tests/test_search.py::TestSearch::test_search_custom_exception_with_invalid_list
FAILED tests/test_search.py::TestSearch::test_search_custom_exception_with_invalid_text
FAILED tests/test_search.py::TestSearch::test_single - AssertionError: Expect...
FAILED tests/test_search.py::TestSearch::test_unicode_criteria - AssertionErr...
FAILED tests/test_search.py::TestSearch::test_unicode_criteria_with_charset
FAILED tests/test_search.py::TestSearch::test_with_date - AssertionError: Exp...
FAILED tests/test_search.py::TestSearch::test_with_datetime - AssertionError:...
FAILED tests/test_search.py::TestSearch::test_zero_length_quoting - Assertion...
FAILED tests/test_search.py::TestGmailSearch::test_bytes_query - AssertionErr...
FAILED tests/test_search.py::TestGmailSearch::test_bytes_query_with_charset
FAILED tests/test_search.py::TestGmailSearch::test_unicode_criteria_with_charset
FAILED tests/test_sort.py::TestSort::test_all_args - AssertionError: Expected...
FAILED tests/test_sort.py::TestSort::test_multiple_criteria - AssertionError:...
FAILED tests/test_sort.py::TestSort::test_single_criteria - AssertionError: E...
FAILED tests/test_starttls.py::TestStarttls::test_command_fails - AssertionEr...
FAILED tests/test_starttls.py::TestStarttls::test_fails_if_called_twice - Ass...
FAILED tests/test_starttls.py::TestStarttls::test_fails_if_ssl_true - Asserti...
FAILED tests/test_starttls.py::TestStarttls::test_works - AssertionError: Exp...
FAILED tests/test_store.py::TestFlags::test_add - AssertionError: Expected 'm...
FAILED tests/test_store.py::TestFlags::test_get - AssertionError: expected ca...
FAILED tests/test_store.py::TestFlags::test_remove - AssertionError: Expected...
FAILED tests/test_store.py::TestFlags::test_set - AssertionError: Expected 'm...
FAILED tests/test_store.py::TestGmailLabels::test_add - AssertionError: Expec...
FAILED tests/test_store.py::TestGmailLabels::test_get - AssertionError: expec...
FAILED tests/test_store.py::TestGmailLabels::test_remove - AssertionError: Ex...
FAILED tests/test_store.py::TestGmailLabels::test_set - AssertionError: Expec...
FAILED tests/test_thread.py::TestThread::test_all_args - AssertionError: Expe...
FAILED tests/test_thread.py::TestThread::test_defaults - AssertionError: Expe...
FAILED tests/test_thread.py::TestThread::test_no_thread_support - AssertionEr...
FAILED tests/test_thread.py::TestThread::test_unsupported_algorithm - Asserti...
======================= 122 failed, 145 passed in 2.86s ========================