Example #1
0
	def test_strConvertedBackToStringFragment(self):
		"""
		L{window._wasSF}s are converted back to C{StringFragment}s before
		being delivered.
		"""
		i = Incoming()
		s = _wasSF("helloworld" * 100)
		sf = StringFragment(s, 0, len(s))
		i.give([[1, sf]])
		self.assertEqual(([sf, sf], False), i.give([[0, sf]]))
Example #2
0
	def test_StringFragmentConvertToStr(self):
		"""
		L{StringFragment}s are converted to C{window._wasSF}s if they are
		undeliverable inside L{Incoming}.
		"""
		i = Incoming()
		s = _wasSF("helloworld" * 100)
		sf = StringFragment(s, 0, len(s))
		i.give([[1, sf]])
		self.assertEqual(totalSizeOf(s), i.getMaxConsumption())