def assertReactorProduces(self, input, expected): wrapped = self.R() reactor = LineAssemblerReporter(wrapped) reactor.start() for i in input: reactor.feed(i) reactor.stop(0) self.assertEqual(wrapped.input, expected)
def test_delegates_to_wrapped(self): wrapped = self.R() reactor = LineAssemblerReporter(wrapped) reactor.start() reactor.feed(b"hello world") reactor.stop(123) self.assert_(wrapped.start_called) self.assertEqual(wrapped.input, [b"hello world"]) self.assertEqual(wrapped.code, 123)
def test_delegates_to_wrapped(self): wrapped = self.R() reactor = LineAssemblerReporter(wrapped) reactor.start() reactor.feed("hello world") reactor.stop(123) self.assert_(wrapped.start_called) self.assertEqual(wrapped.input, ["hello world"]) self.assertEqual(wrapped.code, 123)