'Test stop inside producing.'

def test_stopProducing(self):

    for packet_size in range(1, 10):
        t = proto_helpers.StringIOWithoutClosing()
        a = LineTester()
        a.makeConnection(protocol.FileWrapper(t))
        for i in range(((len(self.stop_buf) // packet_size) + 1)):
            s = self.stop_buf[(i * packet_size):((i + 1) * packet_size)]
            a.dataReceived(s)
        self.assertEqual(self.stop_output, a.received)
