class documentation

Undocumented

Method assertListDelimiterAndMailboxAreStrings Assert a LIST response's delimiter and mailbox are native strings.
Method test_check Trigger the imap.IMAP4Server._cbSelectWork callback by selecting an mbox.
Method test_checkFail Trigger the imap.IMAP4Server._ebSelectWork errback by failing when we select an mbox.
Method test_examine IMAP4Client.examine issues an EXAMINE command to the server and returns a Deferred which fires with a dict with as many of the following keys as the server includes in its response: 'FLAGS', 'EXISTS', ...
Method test_loginException Any exception raised by IMAP4Server.authenticateLogin that is not UnauthorizedLogin is logged results in a BAD response.
Method test_loginWithoutPortal Attempting to log into a server that has no Portal results in a failed login.
Method test_mailboxWithoutNamespace A mailbox that does not provide INamespacePresenter returns empty lists for its personal, shared, and user namespaces.
Method test_nonIAccountAvatar The server responds with a BAD response when its portal attempts to log a user in with checker that claims to support IAccount but returns an an avatar interface that is not IAccount.
Method test_selectWithoutMailbox A client that selects a mailbox that does not exist receives a NO response.
Method testCapability Undocumented
Method testCapabilityWithAuth Undocumented
Method testClose Undocumented
Method testCreate Undocumented
Method testDelete Undocumented
Method testDeleteWithInferiorHierarchicalNames Attempting to delete a mailbox with hierarchically inferior names fails with an informative error.
Method testExpunge Undocumented
Method testFailedLogin Undocumented
Method testFailedStatus Undocumented
Method testFullAppend Undocumented
Method testHierarchicalRename Undocumented
Method testIllegalDelete Undocumented
Method testIllegalInboxDelete Undocumented
Method testIllegalInboxRename Undocumented
Method testList Undocumented
Method testLogin Undocumented
Method testLoginRequiringQuoting Undocumented
Method testLogout Undocumented
Method testLSub Undocumented
Method testNamespace Undocumented
Method testNonExistentDelete Undocumented
Method testNoop Undocumented
Method testPartialAppend Undocumented
Method testRename Undocumented
Method testSelect Undocumented
Method testStatus Undocumented
Method testSubscribe Undocumented
Method testUnsubscribe Undocumented
Instance Variable examinedArgs Undocumented
Instance Variable failure Undocumented
Instance Variable listed Undocumented
Instance Variable loggedOut Undocumented
Instance Variable namespaceArgs Undocumented
Instance Variable responses Undocumented
Instance Variable result Undocumented
Instance Variable results Undocumented
Instance Variable selectedArgs Undocumented
Instance Variable stashed Undocumented
Instance Variable statused Undocumented
Method _cbTestClose Undocumented
Method _cbTestCreate Undocumented
Method _cbTestExamine Undocumented
Method _cbTestExpunge Undocumented
Method _cbTestFailedLogin Undocumented
Method _cbTestFailedStatus Undocumented
Method _cbTestFullAppend Undocumented
Method _cbTestHierarchicalRename Undocumented
Method _cbTestLogin Undocumented
Method _cbTestLoginRequiringQuoting Undocumented
Method _cbTestPartialAppend Undocumented
Method _cbTestSelect Undocumented
Method _listSetup Undocumented
Method _testCheck Undocumented

Inherited from IMAP4HelperMixin:

Method assertClientFailureMessage Assert that the provided failure is an IMAP4Exception with the given message.
Method loopback Undocumented
Method setUp Undocumented
Method tearDown Undocumented
Class Variable clientCTX Undocumented
Class Variable serverCTX Undocumented
Instance Variable client Undocumented
Instance Variable connected Undocumented
Instance Variable server Undocumented
Method _cbStopClient Undocumented
Method _ebGeneral Undocumented

Inherited from TestCase (via IMAP4HelperMixin):

Method __call__ Run the test. Should always do exactly the same thing as run().
Method __init__ Construct an asynchronous test case for methodName.
Method addCleanup Extend the base cleanup feature with support for cleanup functions which return Deferreds.
Method assertFailure Fail if deferred does not errback with one of expectedFailures. Returns the original Deferred with callbacks added. You will need to return this Deferred from your test case.
Method deferRunCleanups Run any scheduled cleanups and report errors (if any) to the result. object.
Method deferSetUp Undocumented
Method deferTearDown Undocumented
Method deferTestMethod Undocumented
Method getSuppress Undocumented
Method getTimeout Returns the timeout value set on this test. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a timeout attribute, returns that. Returns util.DEFAULT_TIMEOUT_DURATION...
Instance Variable timeout A real number of seconds. If set, the test will raise an error if it takes longer than timeout seconds. If not set, util.DEFAULT_TIMEOUT_DURATION is used.
Method _cbDeferTestMethod Undocumented
Method _classCleanUp Undocumented
Method _cleanUp Undocumented
Method _deprecateReactor Deprecate iterate, crash and stop on reactor. That is, each method is wrapped in a function that issues a deprecation warning, then calls the original.
Method _ebDeferSetUp Undocumented
Method _ebDeferTearDown Undocumented
Method _ebDeferTestMethod Undocumented
Method _makeReactorMethod Create a method which wraps the reactor method name. The new method issues a deprecation warning and calls the original.
Method _run Run a single method, either a test method or fixture.
Method _runFixturesAndTest Really run setUp, the test method, and tearDown. Any of these may return defer.Deferreds. After they complete, do some reactor cleanup.
Method _undeprecateReactor Restore the deprecated reactor methods. Undoes what _deprecateReactor did.
Method _wait Take a Deferred that only ever callbacks. Block until it happens.
Instance Variable _passed Undocumented
Instance Variable _reactorMethods Undocumented
Instance Variable _timedOut Undocumented

Inherited from SynchronousTestCase (via IMAP4HelperMixin, TestCase):

Method __eq__ Override the comparison defined by the base TestCase which considers instances of the same class with the same _testMethodName to be equal. Since trial puts TestCase instances into a set, that definition of comparison makes it impossible to run the same test method twice...
Method __hash__ Undocumented
Method callDeprecated Call a function that should have been deprecated at a specific version and in favor of a specific alternative, and assert that it was thusly deprecated.
Method flushLoggedErrors Remove stored errors received from the log.
Method flushWarnings Remove stored warnings from the list of captured warnings and return them.
Method getDeprecatedModuleAttribute Retrieve a module attribute which should have been deprecated, and assert that we saw the appropriate deprecation warning.
Method getSkip Return the skip reason set on this test, if any is set. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a skip attribute, returns that in a tuple (...
Method getTodo Return a Todo object if the test is marked todo. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a todo attribute, returns that. Returns ...
Method mktemp Create a new path name which can be used for a new file or directory.
Method patch Monkey patch an object for the duration of the test.
Method run Run the test case, storing the results in result.
Method runTest If no methodName argument is passed to the constructor, run will treat this method as the thing with the actual test inside.
Method shortDescription Undocumented
Instance Variable failureException An exception class, defaulting to FailTest. If the test method raises this exception, it will be reported as a failure, rather than an exception. All of the assertion methods raise this if the assertion fails.
Instance Variable skip None or a string explaining why this test is to be skipped. If defined, the test will not be run. Instead, it will be reported to the result object as 'skipped' (if the TestResult supports skipping).
Instance Variable suppress None or a list of tuples of (args, kwargs) to be passed to warnings.filterwarnings. Use these to suppress warnings raised in a test. Useful for testing deprecated code. See also util.suppress.
Instance Variable todo None, a string or a tuple of (errors, reason) where errors is either an exception class or an iterable of exception classes, and reason is a string. See Todo or makeTodo for more information.
Method _getSkipReason Return the reason to use for skipping a test method.
Method _getSuppress Returns any warning suppressions set for this test. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a suppress attribute, returns that. ...
Method _installObserver Undocumented
Method _removeObserver Undocumented
Method _runCleanups Synchronously run any cleanups which have been added.
Instance Variable _cleanups Undocumented
Instance Variable _observer Undocumented
Instance Variable _parents Undocumented
Instance Variable _testMethodName Undocumented
Instance Variable _warnings Undocumented

Inherited from _Assertions (via IMAP4HelperMixin, TestCase, SynchronousTestCase):

Method assertAlmostEqual Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
Method assertApproximates Fail if first - second > tolerance
Method assertEqual Fail the test if first and second are not equal.
Method assertFalse Fail the test if condition evaluates to True.
Method assertIn Fail the test if containee is not found in container.
Method assertIs Fail the test if first is not second. This is an obect-identity-equality test, not an object equality (i.e. __eq__) test.
Method assertIsInstance Fail if instance is not an instance of the given class or of one of the given classes.
Method assertIsNot Fail the test if first is second. This is an obect-identity-equality test, not an object equality (i.e. __eq__) test.
Method assertNoResult Assert that deferred does not have a result at this point.
Method assertNotAlmostEqual Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
Method assertNotEqual Fail the test if first == second.
Method assertNotIn Fail the test if containee is found in container.
Method assertNotIsInstance Fail if instance is an instance of the given class or of one of the given classes.
Method assertNotSubstring Fail if astring contains substring.
Method assertRaises Fail the test unless calling the function f with the given args and kwargs raises exception. The failure will report the traceback and call stack of the unexpected exception.
Method assertSubstring Fail if substring does not exist within astring.
Method assertTrue Fail the test if condition evaluates to False.
Method assertWarns Fail if the given function doesn't generate the specified warning when called. It calls the function, checks the warning, and forwards the result of the function if everything is fine.
Method fail Absolutely fail the test. Do not pass go, do not collect $200.
Method failureResultOf Return the current failure result of deferred or raise self.failureException.
Method successResultOf Return the current success result of deferred or raise self.failureException.
def assertListDelimiterAndMailboxAreStrings(self, results): (source)

Assert a LIST response's delimiter and mailbox are native strings.

Parameters
resultsA list of tuples as returned by IMAP4Client.list or IMAP4Client.lsub.
def test_check(self): (source)

Trigger the imap.IMAP4Server._cbSelectWork callback by selecting an mbox.

def test_checkFail(self): (source)

Trigger the imap.IMAP4Server._ebSelectWork errback by failing when we select an mbox.

def test_examine(self): (source)

IMAP4Client.examine issues an EXAMINE command to the server and returns a Deferred which fires with a dict with as many of the following keys as the server includes in its response: 'FLAGS', 'EXISTS', 'RECENT', 'UNSEEN', 'READ-WRITE', 'READ-ONLY', 'UIDVALIDITY', and 'PERMANENTFLAGS'.

Unfortunately the server doesn't generate all of these so it's hard to test the client's handling of them here. See IMAP4ClientExamineTests below.

See RFC 3501, section 6.3.2, for details.

def test_loginException(self): (source)

Any exception raised by IMAP4Server.authenticateLogin that is not UnauthorizedLogin is logged results in a BAD response.

def test_loginWithoutPortal(self): (source)

Attempting to log into a server that has no Portal results in a failed login.

def test_mailboxWithoutNamespace(self): (source)

A mailbox that does not provide INamespacePresenter returns empty lists for its personal, shared, and user namespaces.

def test_nonIAccountAvatar(self): (source)

The server responds with a BAD response when its portal attempts to log a user in with checker that claims to support IAccount but returns an an avatar interface that is not IAccount.

def test_selectWithoutMailbox(self): (source)

A client that selects a mailbox that does not exist receives a NO response.

def testCapability(self): (source)

Undocumented

def testCapabilityWithAuth(self): (source)

Undocumented

def testClose(self): (source)

Undocumented

def testCreate(self): (source)

Undocumented

def testDelete(self): (source)

Undocumented

def testDeleteWithInferiorHierarchicalNames(self): (source)

Attempting to delete a mailbox with hierarchically inferior names fails with an informative error.

Returns
A Deferred with assertions.
See Also
https://tools.ietf.org/html/rfc3501#section-6.3.4
def testExpunge(self): (source)

Undocumented

def testFailedLogin(self): (source)

Undocumented

def testFailedStatus(self): (source)

Undocumented

def testFullAppend(self): (source)

Undocumented

def testHierarchicalRename(self): (source)

Undocumented

def testIllegalDelete(self): (source)

Undocumented

def testIllegalInboxDelete(self): (source)

Undocumented

def testIllegalInboxRename(self): (source)

Undocumented

def testList(self): (source)

Undocumented

def testLogin(self): (source)

Undocumented

def testLoginRequiringQuoting(self): (source)

Undocumented

def testLogout(self): (source)

Undocumented

def testLSub(self): (source)

Undocumented

def testNamespace(self): (source)

Undocumented

def testNonExistentDelete(self): (source)

Undocumented

def testNoop(self): (source)

Undocumented

def testPartialAppend(self): (source)

Undocumented

def testRename(self): (source)

Undocumented

def testSelect(self): (source)

Undocumented

def testStatus(self): (source)

Undocumented

def testSubscribe(self): (source)

Undocumented

def testUnsubscribe(self): (source)

Undocumented

examinedArgs = (source)

Undocumented

Undocumented

Undocumented

loggedOut: int = (source)

Undocumented

namespaceArgs = (source)

Undocumented

responses = (source)

Undocumented

Undocumented

Undocumented

selectedArgs = (source)

Undocumented

Undocumented

statused = (source)

Undocumented

def _cbTestClose(self, ignored, m): (source)

Undocumented

def _cbTestCreate(self, ignored, succeed, fail): (source)

Undocumented

def _cbTestExamine(self, ignored): (source)

Undocumented

def _cbTestExpunge(self, ignored, m): (source)

Undocumented

def _cbTestFailedLogin(self, ignored): (source)

Undocumented

def _cbTestFailedStatus(self, ignored): (source)

Undocumented

def _cbTestFullAppend(self, ignored, infile): (source)

Undocumented

def _cbTestHierarchicalRename(self, ignored): (source)

Undocumented

def _cbTestLogin(self, ignored): (source)

Undocumented

def _cbTestLoginRequiringQuoting(self, ignored): (source)

Undocumented

def _cbTestPartialAppend(self, ignored, infile): (source)

Undocumented

def _cbTestSelect(self, ignored): (source)

Undocumented

def _listSetup(self, f): (source)

Undocumented

def _testCheck(self): (source)

Undocumented