'L{IMAP4Client.examine} issues an I{EXAMINE} command to the server and
returns a L{Deferred} which fires with a C{dict} with as many of the
following keys as the server includes in its response: C{\'FLAGS\'},
C{\'EXISTS\'}, C{\'RECENT\'}, C{\'UNSEEN\'}, C{\'READ-WRITE\'}, C{\'READ-ONLY\'},
C{\'UIDVALIDITY\'}, and C{\'PERMANENTFLAGS\'}.
Unfortunately the server doesn\'t generate all of these so it\'s hard to
test the client\'s handling of them here.  See
L{IMAP4ClientExamineTests} below.
See U{RFC 3501<http://www.faqs.org/rfcs/rfc3501.html>}, section 6.3.2,
for details.'

def test_examine(self):

    SimpleServer.theAccount.addMailbox('test-mailbox')
    self.examinedArgs = None
    def login():
        return self.client.login('testuser', 'password-test')
    def examine():
        def examined(args):
            self.examinedArgs = args
            self._cbStopClient(None)
        d = self.client.examine('test-mailbox')
        d.addCallback(examined)
        return d
    d1 = self.connected.addCallback(strip(login))
    d1.addCallback(strip(examine))
    d1.addErrback(self._ebGeneral)
    d2 = self.loopback()
    d = defer.gatherResults([d1, d2])
    return d.addCallback(self._cbTestExamine)
