Index: twisted/protocols/test/test_basic.py
===================================================================
--- twisted/protocols/test/test_basic.py	(revision 37075)
+++ twisted/protocols/test/test_basic.py	(working copy)
@@ -54,7 +54,8 @@
     @type delimiter: C{bytes}
     @ivar delimiter: character used between received lines.
     @type MAX_LENGTH: C{int}
-    @ivar MAX_LENGTH: size of a line when C{lineLengthExceeded} will be called.
+    @ivar MAX_LENGTH: size of a line when C{lineLengthExceeded}
+        will be called.
     @type clock: L{twisted.internet.task.Clock}
     @ivar clock: clock simulating reactor callLater. Pass it to constructor if
         you want to use the pause/rawpause functionalities.
@@ -105,8 +106,8 @@
 
     def rawDataReceived(self, data):
         """
-        Read raw data, until the quantity specified by a previous 'len' line is
-        reached.
+        Read raw data, until the quantity specified by a previous 'len'
+        line is reached.
         """
         data, rest = data[:self.length], data[self.length:]
         self.length = self.length - len(data)
@@ -260,7 +261,8 @@
         a.makeConnection(protocol.FileWrapper(t))
         a.dataReceived(b'produce\nhello world\nunproduce\ngoodbye\n')
         self.assertEqual(a.received,
-                          [b'produce', b'hello world', b'unproduce', b'goodbye'])
+                          [b'produce', b'hello world', b'unproduce',
+                            b'goodbye'])
 
 
     def test_clearLineBuffer(self):
@@ -311,8 +313,8 @@
 
     def test_maximumLineLengthRemaining(self):
         """
-        C{LineReceiver} disconnects the transport it if receives a non-finished
-        line longer than its C{MAX_LENGTH}.
+        C{LineReceiver} disconnects the transport it if receives a
+        non-finished line longer than its C{MAX_LENGTH}.
         """
         proto = basic.LineReceiver()
         transport = proto_helpers.StringTransport()
@@ -425,7 +427,8 @@
 
 
 
-class NetstringReceiverTestCase(unittest.SynchronousTestCase, LPTestCaseMixin):
+class NetstringReceiverTestCase(unittest.SynchronousTestCase,
+                                LPTestCaseMixin):
 
     strings = [b'hello', b'world', b'how', b'are', b'you123', b':today',
                b"a" * 515]
@@ -715,7 +718,7 @@
         r = self.getProtocol()
         r.sendString(b"b" * 16)
         self.assertEqual(r.transport.value(),
-            struct.pack(r.structFormat, 16) + b"b" * 16)
+                        struct.pack(r.structFormat, 16) + b"b" * 16)
 
 
     def test_lengthLimitExceeded(self):
@@ -735,8 +738,8 @@
     def test_longStringNotDelivered(self):
         """
         If a length prefix for a string longer than C{MAX_LENGTH} is delivered
-        to C{dataReceived} at the same time as the entire string, the string is
-        not passed to C{stringReceived}.
+        to C{dataReceived} at the same time as the entire string, the string
+        is not passed to C{stringReceived}.
         """
         r = self.getProtocol()
         r.MAX_LENGTH = 10
@@ -749,22 +752,22 @@
 class RecvdAttributeMixin(object):
     """
     Mixin defining tests for string receiving protocols with a C{recvd}
-    attribute which should be settable by application code, to be combined with
-    L{IntNTestCaseMixin} on a L{TestCase} subclass
+    attribute which should be settable by application code, to be combined
+    with L{IntNTestCaseMixin} on a L{TestCase} subclass
     """
 
     def makeMessage(self, protocol, data):
         """
-        Return C{data} prefixed with message length in C{protocol.structFormat}
-        form.
+        Return C{data} prefixed with message length in
+        C{protocol.structFormat} form.
         """
         return struct.pack(protocol.structFormat, len(data)) + data
 
 
     def test_recvdContainsRemainingData(self):
         """
-        In stringReceived, recvd contains the remaining data that was passed to
-        dataReceived that was not part of the current message.
+        In stringReceived, recvd contains the remaining data that was passed
+        to dataReceived that was not part of the current message.
         """
         result = []
         r = self.getProtocol()
@@ -860,7 +863,8 @@
 
 
 
-class Int32TestCase(unittest.SynchronousTestCase, IntNTestCaseMixin, RecvdAttributeMixin):
+class Int32TestCase(unittest.SynchronousTestCase, IntNTestCaseMixin,
+                    RecvdAttributeMixin):
     """
     Test case for int32-prefixed protocol
     """
@@ -890,7 +894,8 @@
 
 
 
-class Int16TestCase(unittest.SynchronousTestCase, IntNTestCaseMixin, RecvdAttributeMixin):
+class Int16TestCase(unittest.SynchronousTestCase, IntNTestCaseMixin,
+                    RecvdAttributeMixin):
     """
     Test case for int16-prefixed protocol
     """
@@ -929,8 +934,8 @@
 
 class NewStyleInt16TestCase(Int16TestCase):
     """
-    This test case verifies that IntNStringReceiver still works when inherited
-    by a new-style class.
+    This test case verifies that IntNStringReceiver still works
+    when inherited by a new-style class.
     """
     if _PY3:
         skip = _PY3NEWSTYLESKIP
@@ -948,7 +953,8 @@
 
 
 
-class Int8TestCase(unittest.SynchronousTestCase, IntNTestCaseMixin, RecvdAttributeMixin):
+class Int8TestCase(unittest.SynchronousTestCase, IntNTestCaseMixin,
+                    RecvdAttributeMixin):
     """
     Test case for int8-prefixed protocol
     """
@@ -980,8 +986,10 @@
 
 
 class OnlyProducerTransport(object):
-    # Transport which isn't really a transport, just looks like one to
-    # someone not looking very hard.
+    """
+    Transport which isn't really a transport, just looks like one to
+    someone not looking very hard.
+    """
 
     paused = False
     disconnecting = False
@@ -1004,7 +1012,9 @@
 
 
 class ConsumingProtocol(basic.LineReceiver):
-    # Protocol that really, really doesn't want any more bytes.
+    """
+    Protocol that really, really doesn't want any more bytes.
+    """
 
     def lineReceived(self, line):
         self.transport.write(line)
@@ -1013,49 +1023,49 @@
 
 
 class ProducerTestCase(unittest.SynchronousTestCase):
+    """
+    Pause and Resume unittest for Producers
+    """
 
-    def testPauseResume(self):
+    def test_pauseResume(self):
+        """
+        Data should continue to be received while pausing a producer.
+        """
         p = ConsumingProtocol()
         t = OnlyProducerTransport()
         p.makeConnection(t)
 
         p.dataReceived(b'hello, ')
-        self.failIf(t.data)
-        self.failIf(t.paused)
-        self.failIf(p.paused)
+        self.assertEqual(t.data, [])
+        p.pauseProducing()
+        self.assertTrue(p.paused)
 
+        p.resumeProducing()
         p.dataReceived(b'world\r\n')
-
         self.assertEqual(t.data, [b'hello, world'])
-        self.failUnless(t.paused)
-        self.failUnless(p.paused)
+        p.pauseProducing()
+        self.assertTrue(p.paused)
 
         p.resumeProducing()
-
-        self.failIf(t.paused)
-        self.failIf(p.paused)
-
         p.dataReceived(b'hello\r\nworld\r\n')
-
         self.assertEqual(t.data, [b'hello, world', b'hello'])
-        self.failUnless(t.paused)
-        self.failUnless(p.paused)
+        p.pauseProducing()
+        self.assertTrue(p.paused)
 
         p.resumeProducing()
         p.dataReceived(b'goodbye\r\n')
-
         self.assertEqual(t.data, [b'hello, world', b'hello', b'world'])
-        self.failUnless(t.paused)
-        self.failUnless(p.paused)
+        p.pauseProducing()
+        self.assertTrue(p.paused)
 
         p.resumeProducing()
+        self.assertEqual(t.data, [b'hello, world', b'hello', b'world',
+                                    b'goodbye'])
+        p.pauseProducing()
+        self.assertTrue(p.paused)
 
-        self.assertEqual(t.data, [b'hello, world', b'hello', b'world', b'goodbye'])
-        self.failUnless(t.paused)
-        self.failUnless(p.paused)
-
         p.resumeProducing()
-
-        self.assertEqual(t.data, [b'hello, world', b'hello', b'world', b'goodbye'])
-        self.failIf(t.paused)
-        self.failIf(p.paused)
+        self.assertEqual(t.data, [b'hello, world', b'hello', b'world',
+                                    b'goodbye'])
+        p.pauseProducing()
+        self.assertTrue(p.paused)
