r47171 - clean up tests

hawkowl-TA+aISz0psMTMxyoc4vAAJOcrHinNvQL0E9HWUfgJXw@public.gmane.org Tue, 5 Apr 2016 21:59:30 -0600 (MDT)
Newsgroups gmane.comp.python.twisted.commits
Message-ID <[email protected]>
Author: hawkowl
Date: Tue Apr  5 21:59:26 2016
New Revision: 47171

Modified:
   branches/dropped-factory-8272/twisted/web/test/test_http.py

Log:
clean up tests

Modified: branches/dropped-factory-8272/twisted/web/test/test_http.py
==============================================================================
--- branches/dropped-factory-8272/twisted/web/test/test_http.py	(original)
+++ branches/dropped-factory-8272/twisted/web/test/test_http.py	Tue Apr  5 21:59:26 2016
@@ -238,7 +238,11 @@
 
 
 
-class ProtocolNegotiationTests(unittest.TestCase):
+class GenericHTTPChannelTests(unittest.TestCase):
+    """
+    Tests for L{http._genericHTTPChannelProtocol}, a L{HTTPChannel}-alike which
+    can handle different HTTP protocol channels.
+    """
     requests = (
         b"GET / HTTP/1.1\r\n"
         b"Accept: text/html\r\n"
@@ -324,6 +328,15 @@
         )
 
 
+    def test_factory(self):
+        """
+        The C{factory} attribute is taken from the inner channel.
+        """
+        a = http._genericHTTPChannelProtocolFactory(b'')
+        a._channel.factory = b"Foo"
+        self.assertEqual(a.factory, b"Foo")
+
+
 
 class ResponseWriteOrderingTests(unittest.TestCase):
     requests = (
@@ -2342,7 +2355,7 @@
         val = [
             b"GET /path HTTP/1.1\r\n",
             b"\r\n\r\n"
-            ]
+        ]
 
         trans = StringTransport()
         proto.makeConnection(trans)