from in_common.base_request import BaseRequest
import path_setting
from ids_list import get_ids
import pytest
from all_backend_api.thirdphonelogin_request import *

class TestThirdPhoneLogin:

    data = BaseRequest().api_load(path_setting.THIRD_PHONE_LOGIN)

    thirdphonelogin_case,thirdphonelogin_data = get_ids(data,"login_thirdphone")

    @pytest.mark.parametrize("param",thirdphonelogin_data,ids = thirdphonelogin_case)
    def test_thirdphone_login(self,param):

        r = thirdphonelogin_request().thirdphone_login(param["version"],param["phone_data"],param["phone_from_type"])

        if r["error"] == 1:

            assert r['message'] == param["assert"]