'Make sure that the internal buffer equals a specified value.
@param s: the value to compare against buffer
@type s: L{bytes} or L{unicode}'

def check(self, s):

    bufferValue = self.f.getvalue()
    if isinstance(s, unicode):
        bufferValue = bufferValue.decode('utf-8')
    self.assertEqual(bufferValue, s)
