Пример #1
0
 def setUp(self):
     cfg_info = NewConfig()
     self.common, self.headers = cfg_info.get_info()
     t = LoginApi()
     self.access_token = t.get_access_token(self.common, self.headers)
     self.sevicesID = t.get_user_study_center(self.common, self.headers,
                                              self.access_token)
     get_measure_id = GetMeasureInfo(self.common, self.headers,
                                     self.access_token)
     _, self.mID, _ = get_measure_id.get_sys_id(self.sevicesID)
     self.report = GetMeasureReport(self.common, self.headers,
                                    self.access_token)
    def setUpClass(cls):
        cfg_info = NewConfig()
        common, headers = cfg_info.get_info(devices_name="vivox6")
        t = LoginApi()
        cls.access_token = t.get_access_token(common, headers)
        cls.sevicesID = t.get_user_study_center(common, headers, cls.access_token)
        cls.sys = GetMeasureInfo(common, headers, cls.access_token)

        cls.mWords = GetMeasureWords(common, headers, cls.access_token)
        cls.word_postAnswer = PostMeasureWords(common, headers, cls.access_token)

        cls.mGra = GetMeasureGra(common, headers, cls.access_token)
        cls.gra_postAnswer = PostMeasureGra(common, headers, cls.access_token)

        cls.mLis = GetMeasureListen(common, headers, cls.access_token)
        cls.lis_postAnswer = PostMeasureLis(common, headers, cls.access_token)

        cls.mRead = GetMeasureRead(common, headers, cls.access_token)
        cls.rid_postAnswer = PostMeasureRead(common, headers, cls.access_token)

        cls.mWrite = GetMeasureWrite(common, headers, cls.access_token)
        cls.wri_postAnswer = PostMeasureWrite(common, headers, cls.access_token)
Пример #3
0
from testcase.api.measure.write.postmeasureWrite_step2 import PostMeasureWrite
from utils.config import NewConfig


if __name__ == '__main__':
    cfg_info = NewConfig()
    devices = cfg_info.get_info('vivox6')
    common, headers = cfg_info.get_info("vivox6")
    # print("COMMON", common)
    # {'uname': '*****@*****.**', 'pwd': 111111, 'loginUrl': 'https://proxy.langlib.com', 'loginProxy': 'proxy.langlib.com', 'baseUrl': 'https://appncee.langlib.com', 'baseProxy': 'appncee.langlib.com'}
    t = LoginApi()
    access_token = t.get_access_token(common, headers)
    # print(access_token)
    result = t.check_uname(common, headers, access_token)
    # print(result)
    sevicesID = t.get_user_study_center(common, headers, access_token)
    print(sevicesID)
    sys = GetMeasureInfo(common, headers, access_token)
    print("sys", sys)
    sysId, measureID, studyType = sys.get_sys_id(sevicesID)
    if studyType == "VOC":
        mWords = GetMeasureWords(common,headers, access_token)
        currStatus, measureId, currQuestIdx, data = mWords.get_measure_words(sysId)
        all_curr, all_right = mWords.get_all_right_answer(studyType, data)
        print(all_curr, len(all_curr))
        print(all_right, len(all_right))
        postAnswer = PostMeasureWords(common, headers, access_token)
        final_result = postAnswer.post_measure_words(measureID, all_curr, all_right)
        if final_result:
            print("len(final_result)", len(final_result))
            sysId, measureID, studyType = sys.get_sys_id(sevicesID)