Beispiel #1
0
	def test_noDelayFalse(self):
		"""
		If noDelay=False is passed to BetterSite, it does not set NO_DELAY
		on new connections, leaving the default option.
		"""
		br = BetterResource()
		bs = BetterSite(br, noDelay=False)
		channel = bs.buildProtocol(None)
		transport = DummyTCPTransport()
		channel.makeConnection(transport)
		self.assertFalse(transport.everCalledSetTcpNoDelay())

		# Lose the connection to clear HTTPChannel.timeOut, so we don't
		# have a dirty reactor.
		channel.connectionLost(None)
Beispiel #2
0
	def test_noDelayTrue(self):
		"""
		The default options for BetterSite cause NO_DELAY to be set to True
		on new connections.
		"""
		br = BetterResource()
		bs = BetterSite(br)
		channel = bs.buildProtocol(None)
		transport = DummyTCPTransport()
		channel.makeConnection(transport)
		self.assertTrue(transport.everCalledSetTcpNoDelay())
		self.assertTrue(transport.getTcpNoDelay())

		# Lose the connection to clear HTTPChannel.timeOut, so we don't
		# have a dirty reactor.
		channel.connectionLost(None)