import pytest

import path_setting
from all_doctor_api.web_request import web_request
from ids_list import get_ids
from in_common.base_request import BaseRequest


class TestAccountLogin:
    data = BaseRequest().api_load(path_setting.DOCTOR_LOGIN)
    account_login_case, account_login_data = get_ids(data, "account_login")

    @pytest.mark.parametrize("param",account_login_data,ids=account_login_case)
    def test_account_login(self,param):
        r = web_request().account_login(param["name"],param["password"])
        assert r["error"] == param["error"]
        assert r["message"] == param["message"]
