Skip to content

Commit

Permalink
Merge mail-tests-names-7708
Browse files Browse the repository at this point in the history
Author: eeshangarg
Reviewer: exarkun
Fixes: twisted#7708

Rename all of the test case classes in Twisted Mail to conform to the
recently documented test case class naming convention.


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@43518 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
  • Loading branch information
exarkun committed Nov 26, 2014
1 parent 2f75a84 commit ecf9c7f
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 89 deletions.
2 changes: 1 addition & 1 deletion twisted/mail/test/test_bounce.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from twisted.mail import bounce
import rfc822, cStringIO

class BounceTestCase(unittest.TestCase):
class BounceTests(unittest.TestCase):
"""
testcases for bounce message generation
"""
Expand Down
42 changes: 21 additions & 21 deletions twisted/mail/test/test_imap.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def sortNest(l):
l[i] = tuple(sortNest(list(l[i])))
return l

class IMAP4UTF7TestCase(unittest.TestCase):
class IMAP4UTF7Tests(unittest.TestCase):
tests = [
[u'Hello world', 'Hello world'],
[u'Hello & world', 'Hello &- world'],
Expand Down Expand Up @@ -158,7 +158,7 @@ def registerProducer(self, consumer, streaming):
def unregisterProducer(self):
self.consumer = None

class MessageProducerTestCase(unittest.TestCase):
class MessageProducerTests(unittest.TestCase):
def testSinglePart(self):
body = 'This is body text. Rar.'
headers = util.OrderedDict()
Expand Down Expand Up @@ -285,7 +285,7 @@ def cbProduced(result):



class IMAP4HelperTestCase(unittest.TestCase):
class IMAP4HelperTests(unittest.TestCase):
"""
Tests for various helper utilities in the IMAP4 module.
"""
Expand Down Expand Up @@ -1141,7 +1141,7 @@ def loopback(self):



class IMAP4ServerTestCase(IMAP4HelperMixin, unittest.TestCase):
class IMAP4ServerTests(IMAP4HelperMixin, unittest.TestCase):
def testCapability(self):
caps = {}
def getCaps():
Expand Down Expand Up @@ -1756,7 +1756,7 @@ def _cbTestExpunge(self, ignored, m):



class IMAP4ServerSearchTestCase(IMAP4HelperMixin, unittest.TestCase):
class IMAP4ServerSearchTests(IMAP4HelperMixin, unittest.TestCase):
"""
Tests for the behavior of the search_* functions in L{imap4.IMAP4Server}.
"""
Expand Down Expand Up @@ -1894,7 +1894,7 @@ def _cbCheck(self, result, username):
return username
raise UnauthorizedLogin()

class AuthenticatorTestCase(IMAP4HelperMixin, unittest.TestCase):
class AuthenticatorTests(IMAP4HelperMixin, unittest.TestCase):
def setUp(self):
IMAP4HelperMixin.setUp(self)

Expand Down Expand Up @@ -2036,7 +2036,7 @@ def _cbTestFailedPLAIN(self, ignored):



class SASLPLAINTestCase(unittest.TestCase):
class SASLPLAINTests(unittest.TestCase):
"""
Tests for I{SASL PLAIN} authentication, as implemented by
L{imap4.PLAINAuthenticator} and L{imap4.PLAINCredentials}.
Expand Down Expand Up @@ -2088,7 +2088,7 @@ def test_credentialsInvalidResponse(self):



class UnsolicitedResponseTestCase(IMAP4HelperMixin, unittest.TestCase):
class UnsolicitedResponseTests(IMAP4HelperMixin, unittest.TestCase):
def testReadWrite(self):
def login():
return self.client.login('testuser', 'password-test')
Expand Down Expand Up @@ -2276,7 +2276,7 @@ def flagsChanged(self, newFlags):



class HandCraftedTestCase(IMAP4HelperMixin, unittest.TestCase):
class HandCraftedTests(IMAP4HelperMixin, unittest.TestCase):
def testTrailingLiteral(self):
transport = StringTransport()
c = imap4.IMAP4Client()
Expand Down Expand Up @@ -3431,7 +3431,7 @@ def getSubPart(self, part):
self.got_subpart = part
return self.subpart[part]

class NewStoreTestCase(unittest.TestCase, IMAP4HelperMixin):
class NewStoreTests(unittest.TestCase, IMAP4HelperMixin):
result = None
storeArgs = None

Expand Down Expand Up @@ -3701,7 +3701,7 @@ def test_multiPartExtended(self):



class NewFetchTestCase(unittest.TestCase, IMAP4HelperMixin):
class NewFetchTests(unittest.TestCase, IMAP4HelperMixin):
def setUp(self):
self.received_messages = self.received_uid = None
self.result = None
Expand Down Expand Up @@ -4227,7 +4227,7 @@ def testFetchFastUID(self):



class DefaultSearchTestCase(IMAP4HelperMixin, unittest.TestCase):
class DefaultSearchTests(IMAP4HelperMixin, unittest.TestCase):
"""
Test the behavior of the server's SEARCH implementation, particularly in
the face of unhandled search terms.
Expand Down Expand Up @@ -4417,7 +4417,7 @@ def errorReceived(results):



class FetchSearchStoreTestCase(unittest.TestCase, IMAP4HelperMixin):
class FetchSearchStoreTests(unittest.TestCase, IMAP4HelperMixin):
implements(imap4.ISearchableMailbox)

def setUp(self):
Expand Down Expand Up @@ -4600,7 +4600,7 @@ def copy(self, msg):
self.msgs.append(msg)
return len(self.msgs)

class CopyWorkerTestCase(unittest.TestCase):
class CopyWorkerTests(unittest.TestCase):
def testFeaturefulMessage(self):
s = imap4.IMAP4Server()

Expand Down Expand Up @@ -4676,7 +4676,7 @@ def cbCopy(results):
return d.addCallback(cbCopy)


class TLSTestCase(IMAP4HelperMixin, unittest.TestCase):
class TLSTests(IMAP4HelperMixin, unittest.TestCase):
serverCTX = ServerTLSContext and ServerTLSContext()
clientCTX = ClientTLSContext and ClientTLSContext()

Expand Down Expand Up @@ -4785,7 +4785,7 @@ def fetch(self, messages, uid):
self.fetchDeferred.callback(None)
return d

class Timeout(IMAP4HelperMixin, unittest.TestCase):
class TimeoutTests(IMAP4HelperMixin, unittest.TestCase):

def test_serverTimeout(self):
"""
Expand Down Expand Up @@ -4879,7 +4879,7 @@ def test_idleClientDoesDisconnect(self):



class Disconnection(unittest.TestCase):
class DisconnectionTests(unittest.TestCase):
def testClientDisconnectFailsDeferreds(self):
c = imap4.IMAP4Client()
t = StringTransportWithDisconnection()
Expand Down Expand Up @@ -4916,7 +4916,7 @@ def registerProducer(self, producer, streaming):



class Pipelining(unittest.TestCase):
class PipeliningTests(unittest.TestCase):
"""
Tests for various aspects of the IMAP4 server's pipelining support.
"""
Expand Down Expand Up @@ -4988,15 +4988,15 @@ def test_synchronousFetch(self):


if ClientTLSContext is None:
for case in (TLSTestCase,):
for case in (TLSTests,):
case.skip = "OpenSSL not present"
elif interfaces.IReactorSSL(reactor, None) is None:
for case in (TLSTestCase,):
for case in (TLSTests,):
case.skip = "Reactor doesn't support SSL"



class IMAP4ServerFetchTestCase(unittest.TestCase):
class IMAP4ServerFetchTests(unittest.TestCase):
"""
This test case is for the FETCH tests that require
a C{StringTransport}.
Expand Down
38 changes: 19 additions & 19 deletions twisted/mail/test/test_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

from twisted.test.proto_helpers import LineSendingProtocol

class DomainWithDefaultsTestCase(unittest.TestCase):
class DomainWithDefaultsTests(unittest.TestCase):
def testMethods(self):
d = dict([(x, x + 10) for x in range(10)])
d = mail.mail.DomainWithDefaultDict(d, 'Default')
Expand Down Expand Up @@ -143,7 +143,7 @@ def test_repr(self):



class BounceTestCase(unittest.TestCase):
class BounceTests(unittest.TestCase):
def setUp(self):
self.domain = mail.mail.BounceDomain()

Expand All @@ -165,7 +165,7 @@ def testAddUser(self):



class FileMessageTestCase(unittest.TestCase):
class FileMessageTests(unittest.TestCase):
def setUp(self):
self.name = "fileMessage.testFile"
self.final = "final.fileMessage.testFile"
Expand Down Expand Up @@ -209,7 +209,7 @@ def testInterrupted(self):
self.failIf(os.path.exists(self.name))
self.failIf(os.path.exists(self.final))

class MailServiceTestCase(unittest.TestCase):
class MailServiceTests(unittest.TestCase):
def setUp(self):
self.service = mail.mail.MailService()

Expand Down Expand Up @@ -361,7 +361,7 @@ def append():



class MaildirAppendStringTestCase(unittest.TestCase, _AppendTestMixin):
class MaildirAppendStringTests(unittest.TestCase, _AppendTestMixin):
"""
Tests for L{MaildirMailbox.appendMessage} when invoked with a C{str}.
"""
Expand Down Expand Up @@ -441,7 +441,7 @@ def _cbTestAppend(self, ignored, mbox):



class MaildirAppendFileTestCase(unittest.TestCase, _AppendTestMixin):
class MaildirAppendFileTests(unittest.TestCase, _AppendTestMixin):
"""
Tests for L{MaildirMailbox.appendMessage} when invoked with a C{str}.
"""
Expand Down Expand Up @@ -482,7 +482,7 @@ def _cbTestAppend(self, result, mbox):



class MaildirTestCase(unittest.TestCase):
class MaildirTests(unittest.TestCase):
def setUp(self):
self.d = self.mktemp()
mail.maildir.initializeMaildir(self.d)
Expand Down Expand Up @@ -573,7 +573,7 @@ def test_mailbox(self):



class AbstractMaildirDomainTestCase(unittest.TestCase):
class AbstractMaildirDomainTests(unittest.TestCase):
"""
Tests for L{twisted.mail.maildir.AbstractMaildirDomain}.
"""
Expand All @@ -586,7 +586,7 @@ def test_interface(self):



class MaildirDirdbmDomainTestCase(unittest.TestCase):
class MaildirDirdbmDomainTests(unittest.TestCase):
"""
Tests for L{MaildirDirdbmDomain}.
"""
Expand Down Expand Up @@ -741,7 +741,7 @@ def setAliasGroup(self, aliases):
self.aliasGroup = aliases


class ServiceDomainTestCase(unittest.TestCase):
class ServiceDomainTests(unittest.TestCase):
def setUp(self):
self.S = mail.mail.MailService()
self.D = mail.protocols.DomainDeliveryBase(self.S, None)
Expand Down Expand Up @@ -820,7 +820,7 @@ def testValidateFrom(self):
self.D.validateFrom, None, origin
)

class VirtualPOP3TestCase(unittest.TestCase):
class VirtualPOP3Tests(unittest.TestCase):
def setUp(self):
self.tmpdir = self.mktemp()
self.S = mail.mail.MailService()
Expand Down Expand Up @@ -892,7 +892,7 @@ def __init__(self):



class RelayTestCase(unittest.TestCase):
class RelayTests(unittest.TestCase):
def testExists(self):
service = mail.mail.MailService()
domain = mail.relay.DomainQueuer(service)
Expand Down Expand Up @@ -929,7 +929,7 @@ def testExists(self):



class RelayerTestCase(unittest.TestCase):
class RelayerTests(unittest.TestCase):
def setUp(self):
self.tmpdir = self.mktemp()
os.mkdir(self.tmpdir)
Expand Down Expand Up @@ -985,7 +985,7 @@ def notifyFailure(self, factory, message):
def notifyDone(self, factory):
self.done.append(factory)

class ManagedRelayerTestCase(unittest.TestCase):
class ManagedRelayerTests(unittest.TestCase):
def setUp(self):
self.manager = Manager()
self.messages = range(0, 20, 2)
Expand Down Expand Up @@ -1017,7 +1017,7 @@ def testConnectionLost(self):
self.relay.connectionLost(failure.Failure(Exception()))
self.assertEqual(self.manager.done, [self.factory])

class DirectoryQueueTestCase(unittest.TestCase):
class DirectoryQueueTests(unittest.TestCase):
def setUp(self):
# This is almost a test case itself.
self.tmpdir = self.mktemp()
Expand Down Expand Up @@ -1132,7 +1132,7 @@ def tearDownDNS(self):
pass
return defer.DeferredList(dl)

class MXTestCase(unittest.TestCase):
class MXTests(unittest.TestCase):
"""
Tests for L{mail.relaymanager.MXCalculator}.
"""
Expand Down Expand Up @@ -1532,7 +1532,7 @@ def _cbManyRecordsLastResult(self, lastMX, mx, nextMX):
def _cbManyRecordsRepeatSpecificResult(self, againMX, nextMX):
self.assertEqual(str(againMX.name), str(nextMX.name))

class LiveFireExercise(unittest.TestCase):
class LiveFireExerciseTests(unittest.TestCase):
if interfaces.IReactorUDP(reactor, None) is None:
skip = "UDP support is required to determining MX records"

Expand Down Expand Up @@ -1689,7 +1689,7 @@ def eomReceived(self):
def connectionLost(self):
self.lost = True

class AliasTestCase(unittest.TestCase):
class AliasTests(unittest.TestCase):
lines = [
'First line',
'Next line',
Expand Down Expand Up @@ -1893,7 +1893,7 @@ def signalProcess(self, signal):



class ProcessAliasTestCase(unittest.TestCase):
class ProcessAliasTests(unittest.TestCase):
"""
Tests for alias resolution.
"""
Expand Down
2 changes: 1 addition & 1 deletion twisted/mail/test/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
sslSkip = None


class OptionsTestCase(TestCase):
class OptionsTests(TestCase):
"""
Tests for the command line option parser used for I{twistd mail}.
"""
Expand Down
Loading

0 comments on commit ecf9c7f

Please sign in to comment.