コード例 #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 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)
コード例 #3
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)
コード例 #4
0
 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)