'Ensure limiting reader class accesses all bytes of file'

def test_limiting_reader(self):

    BYTES = 1024
    bytes_read = 0
    data = six.StringIO(('*' * BYTES))
    for chunk in utils.LimitingReader(data, BYTES):
        bytes_read += len(chunk)
    self.assertEqual(BYTES, bytes_read)
    bytes_read = 0
    data = six.StringIO(('*' * BYTES))
    reader = utils.LimitingReader(data, BYTES)
    byte = reader.read(1)
    while (len(byte) != 0):
        bytes_read += 1
        byte = reader.read(1)
    self.assertEqual(BYTES, bytes_read)
