import pytest
import path_setting
from all_om_api.achelous_request import achelous_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestAccountLogin:
    data = BaseRequest().api_load(path_setting.ACCOUNT_DATA)
    account_login_case, account_login_data = get_ids(data, "account_login")

    @pytest.mark.parametrize("param",account_login_data,ids=account_login_case)
    def test_batch_add_service(self,param):
        r = achelous_request().account_login(param['username'],param['password'])
        if r["code"] == 0:
            assert r['msg'] == param["assert"]
        elif r["code"] == 20001:
            assert r['msg'] == param["assert"]
        elif r["code"] == 20005:
            assert r['msg'] == param["assert"]
        else:
            assert r['error'] == param["assert"]

