These are the tests that mock out the IMAP4 object. This assumes that the IMAP calls behave as expected: that the imaplib API does not change and that the behavior of IMAP requests (including Gmail IMAP extensions) does not change. Technically, there should be a second set of tests to ensure that these assumptions remain valid, but those are unlikely to change.
This will require the following:
Implementation: Probably a stub class to mock out the necessary behaviors, which allows for subclass stubs?
NB: the incorrect unique ID problem identified in #52 should be fixed before some of these tests (especially around unique ID in Gmail) are implemented.
These are the tests that mock out the
IMAP4object. This assumes that the IMAP calls behave as expected: that theimaplibAPI does not change and that the behavior of IMAP requests (including Gmail IMAP extensions) does not change. Technically, there should be a second set of tests to ensure that these assumptions remain valid, but those are unlikely to change.This will require the following:
Inbox.connection, probably with 2 emails in it, which should cover the following cases:mock_imap.searchis correct for cases where email search string is "ALL" or email search string is "SINCE" with a given time/date stringmock_imap.fetchis correctGmailInbox.connectionneeds the following additional behaviorsmock_imap.uid("SEARCH", ...)should give the mock the behavior when searching by unique IDmock_imap.uid("STORE", ...)should mock the behavior when setting labelsmock_imap.searchneeds to work when given the unique ID for a messageImplementation: Probably a stub class to mock out the necessary behaviors, which allows for subclass stubs?
NB: the incorrect unique ID problem identified in #52 should be fixed before some of these tests (especially around unique ID in Gmail) are implemented.