]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Move the test for unquoted folders in STATUS
authorMenno Smits <menno@freshfoo.com>
Mon, 19 Sep 2016 11:07:08 +0000 (23:07 +1200)
committerMenno Smits <menno@freshfoo.com>
Mon, 19 Sep 2016 11:07:08 +0000 (23:07 +1200)
It's now with the other folder_status tests.

imapclient/test/test_folder_status.py
imapclient/test/test_imapclient.py

index 5bf2c73d90de36bcc1aaea3c4000c854c972bba9..fd85f021c11c73b2b8a998c1d7b2ce505a4a88c2 100644 (file)
@@ -4,6 +4,8 @@
 
 from __future__ import unicode_literals
 
+from mock import Mock
+
 from .imapclient_test import IMAPClientTest
 
 
@@ -39,3 +41,22 @@ class TestFolderStatus(IMAPClientTest):
 
         self.client._imap.status.assert_called_once_with(b'"foo"', '(UIDNEXT)')
         self.assertDictEqual(out, {b'UIDNEXT': 4})
+
+    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 = ["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, {'UIDNEXT': 24369})
+
+        # We've also seen the response contain mailboxes we didn't
+        # ask for. In all known cases, the desired mailbox is last.
+        server_response = ["sent (UIDNEXT 24369)\nINBOX (UIDNEXT 24369)"]
+        mock = Mock(return_value=server_response)
+        self.client._command_and_check = mock
+
+        resp = self.client.folder_status('INBOX', ['UIDNEXT'])
+        self.assertEqual(resp, {'UIDNEXT': 24369})
index 7fd205374fe3a412265a0b347d757657b7dd95ab..71d3867ded3aef51fc38d6dcef5ab31c36207e50 100644 (file)
@@ -146,27 +146,6 @@ class TestListFolders(IMAPClientTest):
         self.assertEqual(folders, [((br'\HasNoChildren',), b'/', 'last')])
 
 
-class TestFolderStatus(IMAPClientTest):
-    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 = ["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, {'UIDNEXT': 24369})
-
-        # We've also seen the response contain mailboxes we didn't
-        # ask for. In all known cases, the desired mailbox is last.
-        server_response = ["sent (UIDNEXT 24369)\nINBOX (UIDNEXT 24369)"]
-        mock = Mock(return_value=server_response)
-        self.client._command_and_check = mock
-
-        resp = self.client.folder_status('INBOX', ['UIDNEXT'])
-        self.assertEqual(resp, {'UIDNEXT': 24369})
-
-
 class TestSelectFolder(IMAPClientTest):
 
     def test_normal(self):