import pytest

from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest


class TestBeautyCardUpdatePhone:
    data = BaseRequest().api_load(path_setting.BEAUTY_CARD_UPDATE_PHONE)
    beauty_card_update_phone_case, beauty_card_update_phone_data = get_ids(data, "beauty_card_update_phone")

    @pytest.mark.parametrize("param", beauty_card_update_phone_data, ids=beauty_card_update_phone_case)
    def test_beauty_card_update_phone(self, param):
        r = janus_request().beauty_card_update_phone(param["authorize_phone"], param["authorize_phone_type"], param["vfc_code"])

        if r["error"] == 1:
            assert r["message"] == param["assert_message"]

