def test_position_update_info_01(self): """测试更新real1位置基本信息""" result = position_update_info(positionId_real1_Gary, positionName, remark) sql = "select name from iot_position where position_id='%s';" % positionId_real1_Gary position_name_sql = get_result_from_sql(sql)[0] self.assertEqual(positionName, position_name_sql)
def test_position_update_info_timezone_02(self): """测试修改real2位置时区""" result = position_update_info_timezone(positionId_real2_Gary, timeZone_8, timeZoneCity) sql = "select time_zone from iot_position where position_id='%s';" % positionId_real2_Gary time_zone_sql = get_result_from_sql(sql)[0] print(time_zone_sql) self.assertEqual("+0", time_zone_sql)
def test_app_position_update_info_02(self): """测试更新real2位置基本信息""" result = app_position_update_info(positionId_real2_Gary, positionName, isDefault) sql = "select name from iot_position where position_id='%s';" % positionId_real2_Gary position_name_sql = get_result_from_sql(sql)[0] self.assertEqual(positionName, position_name_sql)
def test_user_report_info_01(self): """测试上传用户基本信息""" result = user_report_info(nickName=nickName, gender=gender, birthday=birthday, area=area) result_from_sql = get_result_from_sql(sql) self.assertEqual((nickName, gender, birthday, area), result_from_sql)
def test_position_create_05(self): """创建虚拟位置(positionType=0)""" result = position_create(positionType_0, position_virtual_name, parentPositionId=None, timeZone=timeZone, remark=remark, options=options) position_id = json.loads(result.text)["result"]["positionId"] position_id_sql = get_result_from_sql(sql)[0] self.assertEqual(position_id, position_id_sql, "创建的positionId:%s,数据库查询的positionId:%s" % (position_id, position_id_sql))
def test_app_position_create_07(self): """测试timeZone:-0.5""" result = app_position_create(positionName + "1", parentPositionId=None, timeZone="-0.5", isDefault=isDefault, options=options) time_zone_sql = get_result_from_sql(sql_timeZone)[0] self.assertEqual("-0.5", time_zone_sql)
def test_app_position_create_01(self): """ 测试app创建位置-real2 """ result = app_position_create(positionName, parentPositionId, timeZone, isDefault, options) position_id = json.loads(result.text)["result"]["roomId"] position_id_sql = get_result_from_sql(sql)[0] self.assertEqual( position_id, position_id_sql, "创建的positionId:%s,数据库查询的positionId:%s" % (position_id, position_id_sql))
def test_position_create_01(self): """ 测试创建位置 1、调用创建接口 2、获取接口返回的position_id 3、查询数据库中用户下最新的position_id 4、判断是否相等 """ result = position_create(positionType_1, positionName, parentPositionId, timeZone, remark, options) position_id = json.loads(result.text)["result"]["positionId"] position_id_sql = get_result_from_sql(sql)[0] self.assertEqual(position_id, position_id_sql, "创建的positionId:%s,数据库查询的positionId:%s" % (position_id, position_id_sql))
def setUpClass(cls): cls.linkageId = get_result_from_sql(sql)[0]
def setUpClass(cls): cls.sceneId = get_all_result_from_sql(sql) cls.sceneId_Jenny = get_result_from_sql(sql_Jenny)[0]
def test_position_create_08(self): """测试timeZone:-0.5""" result = position_create(positionType_1, position_timeZone_name, parentPositionId=None, timeZone="-0.5", remark=remark, options=options) time_zone_sql = get_result_from_sql(sql_timeZone)[0] self.assertEqual("-0.5", time_zone_sql)