本文整理汇总了Python中cairis.core.EnvironmentParameters.EnvironmentParameters.shortCode方法的典型用法代码示例。如果您正苦于以下问题:Python EnvironmentParameters.shortCode方法的具体用法?Python EnvironmentParameters.shortCode怎么用?Python EnvironmentParameters.shortCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cairis.core.EnvironmentParameters.EnvironmentParameters
的用法示例。
在下文中一共展示了EnvironmentParameters.shortCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testStandardEnvironment
# 需要导入模块: from cairis.core.EnvironmentParameters import EnvironmentParameters [as 别名]
# 或者: from cairis.core.EnvironmentParameters.EnvironmentParameters import shortCode [as 别名]
def testStandardEnvironment(self):
iep1 = EnvironmentParameters(self.ienvs[0]["theName"],self.ienvs[0]["theShortCode"],self.ienvs[0]["theDescription"])
iep2 = EnvironmentParameters(self.ienvs[1]["theName"],self.ienvs[1]["theShortCode"],self.ienvs[1]["theDescription"])
iep3 = EnvironmentParameters(self.ienvs[2]["theName"],self.ienvs[2]["theShortCode"],self.ienvs[2]["theDescription"])
b = Borg()
b.dbProxy.addEnvironment(iep1)
b.dbProxy.addEnvironment(iep2)
b.dbProxy.addEnvironment(iep3)
oenvs = b.dbProxy.getEnvironments()
oep1 = oenvs[self.ienvs[0]["theName"]]
self.assertEqual(iep1.name(), oep1.name())
self.assertEqual(iep1.shortCode(),oep1.shortCode())
self.assertEqual(iep1.description(),oep1.description())
oep2 = oenvs[self.ienvs[1]["theName"]]
self.assertEqual(iep2.name(), oep2.name())
self.assertEqual(iep2.shortCode(),oep2.shortCode())
self.assertEqual(iep2.description(),oep2.description())
oep3 = oenvs[self.ienvs[2]["theName"]]
self.assertEqual(iep3.name(), oep3.name())
self.assertEqual(iep3.shortCode(),oep3.shortCode())
self.assertEqual(iep3.description(),oep3.description())
b.dbProxy.deleteEnvironment(oep1.id())
b.dbProxy.deleteEnvironment(oep2.id())
b.dbProxy.deleteEnvironment(oep3.id())
示例2: testCompositeEnvironment
# 需要导入模块: from cairis.core.EnvironmentParameters import EnvironmentParameters [as 别名]
# 或者: from cairis.core.EnvironmentParameters.EnvironmentParameters import shortCode [as 别名]
def testCompositeEnvironment(self):
iep1 = EnvironmentParameters(self.ienvs[0]["theName"],self.ienvs[0]["theShortCode"],self.ienvs[0]["theDescription"])
iep2 = EnvironmentParameters(self.ienvs[1]["theName"],self.ienvs[1]["theShortCode"],self.ienvs[1]["theDescription"])
iep3 = EnvironmentParameters(self.ienvs[2]["theName"],self.ienvs[2]["theShortCode"],self.ienvs[2]["theDescription"])
b = Borg()
b.dbProxy.addEnvironment(iep1)
b.dbProxy.addEnvironment(iep2)
b.dbProxy.addEnvironment(iep3)
iep4 = EnvironmentParameters(self.ienvs[3]["Composite_name"],'COMP','Composite test',[iep1.name(),iep2.name(),iep3.name()],self.ienvs[4]["Duplication"])
b.dbProxy.addEnvironment(iep4)
oenvs = b.dbProxy.getEnvironments()
oep4 = oenvs[self.ienvs[3]["Composite_name"]]
self.assertEqual(iep4.name(), oep4.name())
self.assertEqual(iep4.shortCode(),oep4.shortCode())
self.assertEqual(iep4.description(),oep4.description())
self.assertEqual(iep4.environments(),oep4.environments())
self.assertEqual(iep4.duplicateProperty(),oep4.duplicateProperty())
oep1 = oenvs[self.ienvs[0]["theName"]]
oep2 = oenvs[self.ienvs[1]["theName"]]
oep3 = oenvs[self.ienvs[2]["theName"]]
self.assertRaises(DatabaseProxyException,b.dbProxy.deleteEnvironment,oep1.id())
b.dbProxy.deleteEnvironment(oep4.id())
b.dbProxy.deleteEnvironment(oep1.id())
b.dbProxy.deleteEnvironment(oep2.id())
b.dbProxy.deleteEnvironment(oep3.id())