diff options
Diffstat (limited to 'test/test_email_server.py')
-rw-r--r-- | test/test_email_server.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_email_server.py b/test/test_email_server.py new file mode 100644 index 0000000..3be9824 --- /dev/null +++ b/test/test_email_server.py @@ -0,0 +1,17 @@ +import unittest +from unittest import mock + +import archive_folder + + +class TestEmailServer(unittest.TestCase): + + # Ok, data = box.login(username, password) + # Ok, data = box.capability() + + @mock.patch.object(archive_folder.imaplib, 'IMAP4_SSL', autospec=True) + def test_server_initialization(self, mock_imapobj): + mock_imapobj.login.return_value = ('OK', 'FAKED success') + host = 'fakehost' + box = archive_folder.EmailServer(host, 'FakeArchive') + mock_imapobj.assert_called_with(host) |