def size_(got, mandatory_or_optional, expect):
    """
    check if expected size match result size
    """
    if mandatory_or_optional == 'mandatory':
        if not got:
            assert False, 'expect mandatory'
        elif expect is 0:
            pass
        else:
            assert got == expect, 'expect size `%s`, got `%s`' % (expect, got)
    elif not got:
        pass
    elif expect is 0:
        pass
    else:
        assert got == expect, 'expect size `%s`, got `%s`' % (expect, got)
