'Test to verify that the write function works as expected'

def test_write(self):

    receiver = self.Receiver()
    relay = loopback.LoopbackRelay(receiver)
    relay.write('abc')
    relay.write('def')
    self.assertEqual(receiver.data, '')
    relay.clearBuffer()
    self.assertEqual(receiver.data, 'abcdef')
