def test_valume(self):
        print json.loads(getConf("data", "lite_player")).values()
        player_ids = ",".join(str(x).encode("utf-8") for x in json.loads(getConf("data", "lite_player")).values())
        start_time = getNowTime()
        print start_time

        ''' step1 设置音量值 '''
        valume_value = 50
        task_id = 16
        response = rq_command(task_id=task_id, value=valume_value, player_ids=player_ids)
        print response
        '''check1: 音量控制命令返回'''
        self.assertTrue(response["status"] == [11312001], 'lite 音量调节失败')
        time.sleep(5)


        '''step2: 音量控制 日志查询'''
        end_time = getNowTime()
        print end_time
        response = rq_commandHistory(player_ids=player_ids, ttid=9, synPlatform=1, asyPlatform=4,
                                      start_time=start_time, end_time=end_time, status='1,2', offset=0, limit=100,
                                      sort='start_time', sortType='desc')
        print response

        '''check2: 验证音量控制命令日志'''
        self.assertTrue(response["status"] == [10000001], 'lite 获取音量调节日志失败')

        '''验证返回的日志结果'''
        assertControlLog(self,response,"音量调节",ratio=valume_value,scheduledTaskstatus=1,task_id=task_id)
Beispiel #2
0
    def test_HDMI(self):
        print json.loads(getConf("data", "lite_player")).values()
        player_ids = ",".join(str(x).encode("utf-8") for x in json.loads(getConf("data", "lite_player")).values())
        start_time = getNowTime()
        print start_time
        task_id = 8
        ''' step1 设置HDMI源 '''
        response = rq_command(task_id=task_id, player_ids=player_ids)
        print response
        '''check1: 设置HDMI源命令返回'''
        self.assertTrue(response["status"] == [11312001], 'lite 设置HDMI源失败')
        time.sleep(5)

        '''step2: 设置HDMI源 日志查询'''
        end_time = getNowTime()

        print end_time
        response = rq_commandHistory(player_ids=player_ids, ttid=4, synPlatform=1, asyPlatform=2,
                                      start_time=start_time, end_time=end_time, status='1,2', offset=0, limit=100,
                                      sort='start_time', sortType='desc')
        print response

        '''check2: 验证设置HDMI源命令日志'''
        self.assertTrue(response["status"] == [10000001], 'lite 获取HDMI源日志失败')

        '''验证返回的日志结果'''
        assertControlLog(self, response,"设置HDMI源", noApply=["T1-4G", "T3"], task_id=task_id, scheduledTaskstatus=1, )
Beispiel #3
0
    def test_restart(self):
        player_ids = ",".join(
            str(x).encode("utf-8")
            for x in json.loads(getConf("data", "lite_player")).values())
        start_time = getNowTime()
        print start_time
        task_id = 1
        ''' step1 重启 '''
        response = rq_command(task_id=task_id, player_ids=player_ids)
        print response
        '''check1: 重启命令返回'''
        self.assertTrue(response["status"] == [11312001],
                        'this Command is failed')
        time.sleep(20)

        for i in range(20):
            '''step2: 重启 日志查询'''
            print "第" + str(i + 1) + "次查询"
            time.sleep(3)
            end_time = getNowTime()
            response = rq_commandHistory(player_ids=player_ids,
                                         ttid=1,
                                         synPlatform=1,
                                         asyPlatform=2,
                                         start_time=start_time,
                                         end_time=end_time,
                                         status='1,2',
                                         offset=0,
                                         limit=100,
                                         sort='start_time',
                                         sortType='asc')
            if response["data"]["count"] == len(
                    json.loads(getConf("data", "lite_player")).keys()):
                print end_time
                print response
                break
        '''check2: 验证设置同步播放命令日志'''
        self.assertTrue(response["status"] == [10000001],
                        'this Command is failed')
        '''验证返回的日志结果'''
        assertControlLog(self,
                         response,
                         "设置同步播放",
                         task_id=task_id,
                         scheduledTaskstatus=1)
 def test_brightness(self):
     print json.loads(getConf("data", "lite_player")).values()
     player_ids = ",".join(
         str(x).encode("utf-8")
         for x in json.loads(getConf("data", "lite_player")).values())
     start_time = getNowTime(addHours=-8)
     print start_time
     ''' step1 设置亮度值 '''
     bright_value = 60
     task_id = 17
     response = rq_command(task_id=task_id,
                           value=bright_value,
                           player_ids=player_ids)
     print response
     '''check1: 亮度控制命令返回'''
     self.assertTrue(response["status"] == [11312001], 'lite设置亮度失败')
     time.sleep(5)
     '''step2: 亮度控制 日志查询'''
     end_time = getNowTime(addHours=-8)
     print end_time
     # time.sleep(10)
     response1 = rq_commandHistory(player_ids=player_ids,
                                   ttid=10,
                                   synPlatform=1,
                                   asyPlatform=4,
                                   start_time=start_time,
                                   end_time=end_time,
                                   status='1,2',
                                   offset=0,
                                   limit=50,
                                   sort='start_time',
                                   sortType='desc')
     print response1
     '''check2: 验证亮度控制命令日志'''
     self.assertTrue(response1["status"] == [10000001], 'lite获取亮度日志失败')
     '''验证返回的日志结果'''
     assertControlLog(self,
                      response1,
                      "亮度调节",
                      ratio=bright_value,
                      scheduledTaskstatus=1,
                      task_id=str(task_id))
    def test_openScreen(self):
        print json.loads(getConf("data", "lite_player")).values()
        player_ids = ",".join(
            str(x).encode("utf-8")
            for x in json.loads(getConf("data", "lite_player")).values())
        start_time = getNowTime()
        print start_time
        task_id = "2"
        ''' step1 开屏 '''
        response = rq_command(task_id=task_id, player_ids=player_ids)
        print response
        '''check1: 开屏命令返回'''
        self.assertTrue(response["status"] == [11312001], 'lite开屏命令失败')
        time.sleep(5)
        '''step2: 开屏 日志查询'''
        end_time = getNowTime()

        print end_time
        response = rq_commandHistory(player_ids=player_ids,
                                     ttid=2,
                                     synPlatform=1,
                                     asyPlatform=2,
                                     start_time=start_time,
                                     end_time=end_time,
                                     status='1,2',
                                     offset=0,
                                     limit=100,
                                     sort='start_time',
                                     sortType='desc')
        print response
        '''check2: 验证设置开屏命令日志'''
        self.assertTrue(response["status"] == [10000001], 'lite获取屏幕状态日志失败')
        '''验证返回的日志结果'''
        assertControlLog(self,
                         response,
                         "开屏",
                         task_id=task_id,
                         scheduledTaskstatus=1)