import pytest

from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.user_request import user_request
import  json

class TestFollowAdd:
    data = BaseRequest().api_load(path_setting.FOLLOW_ADD)
    follow_add_case, follow_add_data = get_ids(data, "follow_add")

    @pytest.mark.parametrize("param",follow_add_data, ids=follow_add_case)
    def test_follow_add(self, param):
        r = user_request().follow_add(param["uid"], param["from_live"])
#        r=json.loads(r)
#        print("---------",r,type(r))
        if r["error"] == 0:
            assert r["error"] == param["assert"]
        if r["error"] == 1:
            assert r["message"] == param["assert1"]