Beispiel #1
0
 def test_getChildWithSpecial(self):
     """
     The L{ReverseProxyResource} return by C{getChild} has a path which has
     already been quoted.
     """
     resource = ReverseProxyResource("127.0.0.1", 1234, "/path")
     child = resource.getChild(" /%", None)
     self.assertEqual(child.path, "/path/%20%2F%25")
Beispiel #2
0
 def test_getChild(self):
     """
     The L{ReverseProxyResource.getChild} method should return a resource
     instance with the same class as the originating resource, forward port
     and host values, and update the path value with the value passed.
     """
     resource = ReverseProxyResource("127.0.0.1", 1234, "/path")
     child = resource.getChild("foo", None)
     # The child should keep the same class
     self.assertIsInstance(child, ReverseProxyResource)
     self.assertEquals(child.path, "/path/foo")
     self.assertEquals(child.port, 1234)
     self.assertEquals(child.host, "127.0.0.1")
Beispiel #3
0
 def test_getChild(self):
     """
     The L{ReverseProxyResource.getChild} method should return a resource
     instance with the same class as the originating resource, forward
     port, host, and reactor values, and update the path value with the
     value passed.
     """
     reactor = MemoryReactor()
     resource = ReverseProxyResource("127.0.0.1", 1234, "/path", reactor)
     child = resource.getChild('foo', None)
     # The child should keep the same class
     self.assertIsInstance(child, ReverseProxyResource)
     self.assertEqual(child.path, "/path/foo")
     self.assertEqual(child.port, 1234)
     self.assertEqual(child.host, "127.0.0.1")
     self.assertIdentical(child.reactor, resource.reactor)
Beispiel #4
0
 def test_getChild(self):
     """
     The L{ReverseProxyResource.getChild} method should return a resource
     instance with the same class as the originating resource, forward
     port, host, and reactor values, and update the path value with the
     value passed.
     """
     reactor = MemoryReactor()
     resource = ReverseProxyResource("127.0.0.1", 1234, "/path", reactor)
     child = resource.getChild('foo', None)
     # The child should keep the same class
     self.assertIsInstance(child, ReverseProxyResource)
     self.assertEqual(child.path, "/path/foo")
     self.assertEqual(child.port, 1234)
     self.assertEqual(child.host, "127.0.0.1")
     self.assertIdentical(child.reactor, resource.reactor)