def testSendNotimeout(self):
     basedir = "test_slave_commands_base.logging.sendNotimeout"
     b = FakeSlaveBuilder(False, basedir)
     s = ShellCommand(b, stdoutCommand('hello'), basedir)
     data = "x" * (ShellCommand.BUFFER_SIZE + 1)
     s._addToBuffers('stdout', data)
     self.failUnless(len(b.updates), 1)
 def testSendChunked(self):
     basedir = "test_slave_commands_base.logging.sendBufferedChunked"
     b = FakeSlaveBuilder(False, basedir)
     s = ShellCommand(b, stdoutCommand('hello'), basedir)
     data = "x" * ShellCommand.CHUNK_LIMIT * 2
     s._addToBuffers('stdout', data)
     s._sendBuffers()
     self.failUnless(len(b.updates), 2)
 def testSendBuffered(self):
     basedir = "test_slave_commands_base.logging.sendBuffered"
     b = FakeSlaveBuilder(False, basedir)
     s = ShellCommand(b, stdoutCommand('hello'), basedir)
     s._addToBuffers('stdout', 'hello ')
     s._addToBuffers('stdout', 'world')
     s._sendBuffers()
     self.failUnlessEqual(b.updates, [{'stdout': 'hello world'}])