当前位置: 首页>>代码示例>>Python>>正文


Python GenericMetadata.deleteHydroShareEntry方法代码示例

本文整理汇总了Python中ecohydrolib.metadata.GenericMetadata.deleteHydroShareEntry方法的典型用法代码示例。如果您正苦于以下问题:Python GenericMetadata.deleteHydroShareEntry方法的具体用法?Python GenericMetadata.deleteHydroShareEntry怎么用?Python GenericMetadata.deleteHydroShareEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ecohydrolib.metadata.GenericMetadata的用法示例。


在下文中一共展示了GenericMetadata.deleteHydroShareEntry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_delete

# 需要导入模块: from ecohydrolib.metadata import GenericMetadata [as 别名]
# 或者: from ecohydrolib.metadata.GenericMetadata import deleteHydroShareEntry [as 别名]
 def test_delete(self):
     GenericMetadata.writeManifestEntry(self.context, "key1", "value_one")
     manifest = GenericMetadata.readManifestEntries(self.context)
     self.assertTrue(manifest["key1"] == "value_one")
     GenericMetadata.deleteManifestEntry(self.context, "key1")
     manifest = GenericMetadata.readManifestEntries(self.context)
     self.assertTrue(not 'key1' in manifest)
     
     GenericMetadata.writeStudyAreaEntry(self.context, "key1", "value_one")
     studyArea = GenericMetadata.readStudyAreaEntries(self.context)
     self.assertTrue(studyArea["key1"] == "value_one")
     GenericMetadata.deleteStudyAreaEntry(self.context, 'key1')
     studyArea = GenericMetadata.readStudyAreaEntries(self.context)
     self.assertTrue(not 'key1' in studyArea)
     
     GenericMetadata.writeClimatePointEntry(self.context, "key1", "value_one")
     climatePoint = GenericMetadata.readClimatePointEntries(self.context)
     self.assertTrue(climatePoint["key1"] == "value_one")
     GenericMetadata.deleteClimatePointEntry(self.context, 'key1')
     climatePoint = GenericMetadata.readClimatePointEntries(self.context)
     self.assertTrue(not 'key1' in climatePoint)
     
     GenericMetadata.writeClimateGridEntry(self.context, "key1", "value_one")
     climateGrid = GenericMetadata.readClimateGridEntries(self.context)
     self.assertTrue(climateGrid["key1"] == "value_one")
     GenericMetadata.deleteClimateGridEntry(self.context, 'key1')
     climateGrid = GenericMetadata.readClimateGridEntries(self.context)
     self.assertTrue(not 'key1' in climateGrid)
     # Delete and empty entry
     GenericMetadata.deleteClimateGridEntry(self.context, "not_in_store")
     
     GenericMetadata.writeHydroShareEntry(self.context, "resource_id", "fae3688aa1354fb2a558380669229a66")
     hydroshare = GenericMetadata.readHydroShareEntries(self.context)
     self.assertTrue(hydroshare["resource_id"] == "fae3688aa1354fb2a558380669229a66")
     GenericMetadata.deleteHydroShareEntry(self.context, "resource_id")
     hydroshare = GenericMetadata.readHydroShareEntries(self.context)
     self.assertTrue(not 'resource_id' in hydroshare)
开发者ID:dblodgett-usgs,项目名称:EcohydroLib,代码行数:39,代码来源:test_metadata.py


注:本文中的ecohydrolib.metadata.GenericMetadata.deleteHydroShareEntry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。