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


Python EDPlugin.setDataOutput方法代码示例

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


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

示例1: testSetDataOutput

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import setDataOutput [as 别名]
 def testSetDataOutput(self):
     """
     Test the setDataOutput method with different arguments
     """
     # Test 1: default output
     edPlugin = EDPlugin()
     xsDataStringTest = XSDataString("Test")
     edPlugin.setDataOutput(xsDataStringTest)
     EDAssert.equal(xsDataStringTest.marshal(), edPlugin.getDataOutput().marshal(), "Test 1: default output")
     # Test 2: named output
     edPlugin = EDPlugin()
     xsDataStringTest = XSDataString("Test")
     edPlugin.setDataOutput(xsDataStringTest, "testData")
     EDAssert.equal(xsDataStringTest.marshal(), edPlugin.getDataOutput("testData")[0].marshal(), "Test 2: named output")
     # Test 3: several inputs with the same name
     edPlugin = EDPlugin()
     xsDataStringTest1 = XSDataString("Test1")
     xsDataStringTest2 = XSDataString("Test2")
     edPlugin.setDataOutput(xsDataStringTest1, "testData")
     edPlugin.setDataOutput(xsDataStringTest2, "testData")
     pyListDataOutput = edPlugin.getDataOutput("testData")
     EDAssert.equal(xsDataStringTest1.marshal(), pyListDataOutput[0].marshal(), "Test 3: several inputs with the same name, 1")
     EDAssert.equal(xsDataStringTest2.marshal(), pyListDataOutput[1].marshal(), "Test 3: several inputs with the same name, 2")
     # Test 6: test of delDataOutput
     edPlugin = EDPlugin()
     xsDataStringTest = XSDataString("Test")
     edPlugin.setDataOutput(xsDataStringTest.marshal())
     edPlugin.delDataOutput()
     EDAssert.equal(None, edPlugin.getDataOutput(), "Test 6: test of delDataOutput")
开发者ID:olofsvensson,项目名称:edna-kernel,代码行数:31,代码来源:EDTestCaseEDPlugin.py

示例2: testWarningIfNoOutputData

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import setDataOutput [as 别名]
 def testWarningIfNoOutputData(self):
     # Test warning in case of no output data
     edPlugin = EDPlugin()
     edPlugin.configure()
     edPlugin.executeSynchronous()
     xsDataResultReference = XSDataResult()
     listOfWarningMessages = edPlugin.getListOfWarningMessages()
     EDAssert.equal(1, len(listOfWarningMessages), "Test warning in case of no output data, no warning messages = 1")
     EDAssert.equal(xsDataResultReference.marshal(), edPlugin.dataOutput.marshal(), "Test warning in case of no output data, default XSDataResult")
     # Test warning in case of named output data
     edPlugin = EDPlugin()
     edPlugin.configure()
     xsDataStringTest = XSDataString("Test1")
     edPlugin.setDataOutput(xsDataStringTest, "test") 
     edPlugin.executeSynchronous()
     xsDataResultReference = XSDataResult()
     listOfWarningMessages = edPlugin.getListOfWarningMessages()
     EDAssert.equal(0, len(listOfWarningMessages), "Test warning in case of named output data, no warning messages = 0")
开发者ID:olofsvensson,项目名称:edna-kernel,代码行数:20,代码来源:EDTestCaseEDPlugin.py

示例3: testWriteDataOutput

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import setDataOutput [as 别名]
 def testWriteDataOutput(self):
     # Test 1: default Output with XML
     edPlugin = EDPlugin()
     edPlugin.configure()
     xsDataStringTest = XSDataString("Test")
     edPlugin.setDataOutput(xsDataStringTest)
     edPlugin.writeDataOutput()
     EDAssert.equal(True, os.path.exists(os.path.join(edPlugin.getWorkingDirectory(), "_dataOutput.xml")), "Test 1: default Output with XML")
     # Test 2: named Output with XML
     edPlugin = EDPlugin()
     edPlugin.configure()
     xsDataStringTest = XSDataString("Test")
     edPlugin.setDataOutput(xsDataStringTest, "testData")
     edPlugin.writeDataOutput()
     EDAssert.equal(True, os.path.exists(os.path.join(edPlugin.getWorkingDirectory(), "_testData_0_dataOutput.xml")), "Test 2: named Output with XML")
     # Test 3: several Outputs with the same name, XML Output
     edPlugin = EDPlugin()
     edPlugin.configure()
     xsDataStringTest1 = XSDataString("Test1")
     xsDataStringTest2 = XSDataString("Test2")
     edPlugin.setDataOutput(xsDataStringTest1, "testData")
     edPlugin.setDataOutput(xsDataStringTest2, "testData")
     edPlugin.writeDataOutput()
     EDAssert.equal(True, os.path.exists(os.path.join(edPlugin.getWorkingDirectory(), "_testData_0_dataOutput.xml")), "Test 3: several Outputs with the same name, XML Output, 1")
     EDAssert.equal(True, os.path.exists(os.path.join(edPlugin.getWorkingDirectory(), "_testData_1_dataOutput.xml")), "Test 3: several Outputs with the same name, XML Output, 2")
开发者ID:olofsvensson,项目名称:edna-kernel,代码行数:27,代码来源:EDTestCaseEDPlugin.py


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