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


Python EDPlugin.getDataInput方法代码示例

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


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

示例1: testSetDataInput

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import getDataInput [as 别名]
 def testSetDataInput(self):
     """
     Test the setDataInput method with different inputs
     """
     # Test 1: default input with XML
     edPlugin = EDPlugin()
     edPlugin.setXSDataInputClass(XSDataString)
     xsDataStringTest = XSDataString("Test")
     edPlugin.setDataInput(xsDataStringTest.marshal())
     EDAssert.equal(xsDataStringTest.marshal(), edPlugin.getDataInput().marshal(), "Test 1: default input with XML")
     # Test 2: default input with object
     edPlugin = EDPlugin()
     edPlugin.setXSDataInputClass(XSDataString)
     xsDataStringTest = XSDataString("Test")
     edPlugin.setDataInput(xsDataStringTest)
     EDAssert.equal(xsDataStringTest.marshal(), edPlugin.getDataInput().marshal(), "Test 2: default input with object")
     # Test 3: named input with XML
     edPlugin = EDPlugin()
     edPlugin.setXSDataInputClass(XSDataString, "testData")
     xsDataStringTest = XSDataString("Test")
     edPlugin.setDataInput(xsDataStringTest.marshal(), "testData")
     EDAssert.equal(xsDataStringTest.marshal(), edPlugin.getDataInput("testData")[0].marshal(), "Test 3: named input with XML")
     # Test 4: named input with object
     edPlugin = EDPlugin()
     edPlugin.setXSDataInputClass(XSDataString, "testData")
     xsDataStringTest = XSDataString("Test")
     edPlugin.setDataInput(xsDataStringTest, "testData")
     EDAssert.equal(xsDataStringTest.marshal(), edPlugin.getDataInput("testData")[0].marshal(), "Test 4: named input with object")
     # Test 4: several inputs with the same name, XML input
     edPlugin = EDPlugin()
     edPlugin.setXSDataInputClass(XSDataString, "testData")
     xsDataStringTest1 = XSDataString("Test1")
     xsDataStringTest2 = XSDataString("Test2")
     edPlugin.setDataInput(xsDataStringTest1.marshal(), "testData")
     edPlugin.setDataInput(xsDataStringTest2.marshal(), "testData")
     pyListDataInput = edPlugin.getDataInput("testData")
     EDAssert.equal(xsDataStringTest1.marshal(), pyListDataInput[0].marshal(), "Test 4: several inputs with the same name, XML input, 1")
     EDAssert.equal(xsDataStringTest2.marshal(), pyListDataInput[1].marshal(), "Test 4: several inputs with the same name, XML input, 2")
     # Test 5: several inputs with the same name, object input
     edPlugin = EDPlugin()
     edPlugin.setXSDataInputClass(XSDataString, "testData")
     xsDataStringTest1 = XSDataString("Test1")
     xsDataStringTest2 = XSDataString("Test2")
     edPlugin.setDataInput(xsDataStringTest1, "testData")
     edPlugin.setDataInput(xsDataStringTest2, "testData")
     pyListDataInput = edPlugin.getDataInput("testData")
     EDAssert.equal(xsDataStringTest1.marshal(), pyListDataInput[0].marshal(), "Test 5: several inputs with the same name, object input, 1")
     EDAssert.equal(xsDataStringTest2.marshal(), pyListDataInput[1].marshal(), "Test 5: several inputs with the same name, object input, 2")
     # Test 6: test of delDataInput
     edPlugin = EDPlugin()
     edPlugin.setXSDataInputClass(XSDataString)
     xsDataStringTest = XSDataString("Test")
     edPlugin.setDataInput(xsDataStringTest.marshal())
     edPlugin.delDataInput()
     EDAssert.equal(None, edPlugin.getDataInput(), "Test 6: test of delDataInput")
开发者ID:olofsvensson,项目名称:edna-kernel,代码行数:57,代码来源:EDTestCaseEDPlugin.py


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