from yatbaf.bot import Bot
from yatbaf.methods import __all__ as methods

# Bot API 6.9
API_METHODS = (
    "get_updates",
    "set_webhook",
    "delete_webhook",
    "get_webhook_info",
    "get_me",
    "log_out",
    "close",
    "send_message",
    "forward_message",
    "copy_message",
    "send_photo",
    "send_audio",
    "send_document",
    "send_video",
    "send_animation",
    "send_voice",
    "send_video_note",
    "send_media_group",
    "send_location",
    "send_venue",
    "send_contact",
    "send_poll",
    "send_dice",
    "send_chat_action",
    "get_user_profile_photos",
    "get_file",
    "ban_chat_member",
    "unban_chat_member",
    "restrict_chat_member",
    "promote_chat_member",
    "set_chat_administrator_custom_title",
    "ban_chat_sender_chat",
    "unban_chat_sender_chat",
    "set_chat_permissions",
    "export_chat_invite_link",
    "create_chat_invite_link",
    "edit_chat_invite_link",
    "revoke_chat_invite_link",
    "approve_chat_join_request",
    "decline_chat_join_request",
    "set_chat_photo",
    "delete_chat_photo",
    "set_chat_title",
    "set_chat_description",
    "pin_chat_message",
    "unpin_chat_message",
    "unpin_all_chat_messages",
    "leave_chat",
    "get_chat",
    "get_chat_administrators",
    "get_chat_member_count",
    "get_chat_member",
    "set_chat_sticker_set",
    "delete_chat_sticker_set",
    "get_forum_topic_icon_stickers",
    "create_forum_topic",
    "edit_forum_topic",
    "close_forum_topic",
    "reopen_forum_topic",
    "delete_forum_topic",
    "unpin_all_forum_topic_messages",
    "edit_general_forum_topic",
    "close_general_forum_topic",
    "reopen_general_forum_topic",
    "hide_general_forum_topic",
    "unhide_general_forum_topic",
    "answer_callback_query",
    "set_my_name",
    "get_my_name",
    "set_my_commands",
    "delete_my_commands",
    "get_my_commands",
    "set_my_description",
    "get_my_description",
    "set_my_short_description",
    "get_my_short_description",
    "set_chat_menu_button",
    "get_chat_menu_button",
    "set_my_default_administrator_rights",
    "get_my_default_administrator_rights",
    "edit_message_text",
    "edit_message_caption",
    "edit_message_media",
    "edit_message_live_location",
    "stop_message_live_location",
    "edit_message_reply_markup",
    "stop_poll",
    "delete_message",
    "send_sticker",
    "get_sticker_set",
    "get_custom_emoji_stickers",
    "upload_sticker_file",
    "create_new_sticker_set",
    "add_sticker_to_set",
    "set_sticker_position_in_set",
    "delete_sticker_from_set",
    "set_sticker_emoji_list",
    "set_sticker_keywords",
    "set_sticker_mask_position",
    "set_sticker_set_title",
    "set_sticker_set_thumbnail",
    "set_custom_emoji_sticker_set_thumbnail",
    "delete_sticker_set",
    "answer_inline_query",
    "answer_web_app_query",
    "send_invoice",
    "create_invoice_link",
    "answer_shipping_query",
    "answer_pre_checkout_query",
    "set_passport_data_errors",
    "send_game",
    "set_game_score",
    "get_game_high_scores",
    "unpin_all_general_forum_topic_messages",
)


def test_bot_api_methods():
    for method in API_METHODS:
        assert hasattr(Bot, method)


def test_api_methods():
    assert len(methods) == len(API_METHODS)
    m1 = map(lambda x: x.replace("_", ""), API_METHODS)
    m2 = map(lambda x: x.lower(), methods)
    assert sorted(m1) == sorted(m2)
