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_preconditions(self): wrapped = self.R() reactor = LineAssemblerReporter(wrapped) self.failIf(wrapped.start_called) self.failIf(wrapped.input) self.assert_(wrapped.code is None)