def validate_boundary(self, boundary):
    if (not boundary):
        self.fail('Missing boundary')
    if (not is_valid_multipart_boundary(boundary)):
        self.fail(('Invalid boundary: %s' % boundary))
    if (len(boundary) > self.buffer_size):
        self.fail('Boundary longer than buffer size')
def validate_boundary(self, boundary):
    if (not boundary):
        self.fail('Missing boundary')
    if (not is_valid_multipart_boundary(boundary)):
        self.fail(('Invalid boundary: %s' % boundary))
    if (len(boundary) > self.buffer_size):
        self.fail('Boundary longer than buffer size')