예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)