示例#1
0
                        str(unchanged_vars))
                    break
            break

        if not recheck_count:
            main_logger.error(
                "Device Was approved, but it could not get data from device in cassandra"
            )
            raise Exception(
                "Device Was approved, but it could not get data from device in cassandra"
            )

        main_logger.info("Control successfully verified in cassandradb.")


if __name__ == "__main__":
    device_model = "RTH8580WF"
    # agent_id = "ICM1_BGQKEKRXBGFV_contract1"
    agent_id = u'RTH8_3994424_contract1'
    #cleanup()
    token = getToken.login(test_settings.testusername,
                           test_settings.testuserpassword)
    # device_info = test_settings.DEVICE_INFO[device_model]
    # devices = discoverDevice(token, device_info)
    # one_device = devices[0]
    # approveDevice(token, one_device)
    # agent_id = one_device['agent_id']
    controlCommandList = test_settings.test_control_commands['RTH8580WF']

    print(deviceControlTest(token, device_model, agent_id, controlCommandList))
    # cleanup()
示例#2
0
#[服务器地址]

#url = "http://open-get.hivescm.com"
url = "http://open-gateway.beescm.cn:10030"
#url = "http://pre-open-gateway.newbeescm.com"
#url = "http://open-gateway.newbeescm.com"

#开发环境  open-gateway.hivescm.com
#测试环境  open-gateway.beescm.cn
#预发环境  pre-open-gateway.newbeescm.com
#线上环境  open-gateway.newbeescm.com

#[HEADER参数]

api_v = ("v1.0", "memberFind")

#[BODY参数]

with open("requestBody.data", "r") as f:
    ff = f.read()
ff = json.loads(ff)

#测试
akey = "067bcef3f5a347e1ad4972d1081261a9"
asecret = "ea1724eccafc41689f9c785bb0960acf"

#[获取accessToken的应用]

aToken = getToken.login()