本文整理汇总了Python中pyon.public.IonObject.constraint_list方法的典型用法代码示例。如果您正苦于以下问题:Python IonObject.constraint_list方法的具体用法?Python IonObject.constraint_list怎么用?Python IonObject.constraint_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyon.public.IonObject
的用法示例。
在下文中一共展示了IonObject.constraint_list方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _do_test_create_geospatial_point_center
# 需要导入模块: from pyon.public import IonObject [as 别名]
# 或者: from pyon.public.IonObject import constraint_list [as 别名]
def _do_test_create_geospatial_point_center(self, resources):
platformsite_obj = IonObject(RT.PlatformSite,
name='TestPlatformSite',
description='some new TestPlatformSite')
geo_index_obj = IonObject(OT.GeospatialBounds)
geo_index_obj.geospatial_latitude_limit_north = 20.0
geo_index_obj.geospatial_latitude_limit_south = 10.0
geo_index_obj.geospatial_longitude_limit_east = 15.0
geo_index_obj.geospatial_longitude_limit_west = 20.0
platformsite_obj.constraint_list = [geo_index_obj]
platformsite_id = self.OMS.create_platform_site(platformsite_obj)
# now get the dp back to see if it was updated
platformsite_obj = self.OMS.read_platform_site(platformsite_id)
self.assertEquals('some new TestPlatformSite', platformsite_obj.description)
self.assertAlmostEqual(15.0, platformsite_obj.geospatial_point_center.lat, places=1)
#now adjust a few params
platformsite_obj.description = 'some old TestPlatformSite'
geo_index_obj = IonObject(OT.GeospatialBounds)
geo_index_obj.geospatial_latitude_limit_north = 30.0
geo_index_obj.geospatial_latitude_limit_south = 20.0
platformsite_obj.constraint_list = [geo_index_obj]
update_result = self.OMS.update_platform_site(platformsite_obj)
# now get the dp back to see if it was updated
platformsite_obj = self.OMS.read_platform_site(platformsite_id)
self.assertEquals('some old TestPlatformSite', platformsite_obj.description)
self.assertAlmostEqual(25.0, platformsite_obj.geospatial_point_center.lat, places=1)
self.OMS.force_delete_platform_site(platformsite_id)