Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_plan( self ):
"""byronimo.automation.report: test plan report"""
miwfl = workflows.multiinput
# try as real target - stil very simple
res = miwfl.makeTarget( unicode( "this" ) )
plan = miwfl.getReportInstance( Plan )
r = plan.getReport( headline = "unicode workflow test" )
self.failUnless( len( r ) == 6 )
for l in r:
print l
from byronimo.automation.report import Plan
cg = scwfl._callgraph
self.failUnless( len( cg.nodes() ) == 2 )
self.failUnless( len( cg.edges() ) == 1 )
# INPUT REQUIRED - multiple nodes
###############################
res = scwfl.makeTarget( 2.0 )
cg = scwfl._callgraph
self.failUnless( len( cg.nodes() ) == 2 )
self.failUnless( len( cg.edges() ) == 1 )
miwfl = workflows.multiinput
res = miwfl.makeTarget( unicode( "this" ) )
cg = miwfl._callgraph
self.failUnless( len( cg.nodes() ) == 5 )
self.failUnless( len( cg.edges() ) == 4 )
self.failUnless( len( list( wfl.iterNodes() ) ) == 1 )
rate, process = wfl.getTargetRating( unicode( "this" ) )
self.failUnless( rate != 0 )
# shuold be able to provide exactly the same output the workflow itself
res = wfl.makeTarget( unicode( "this" ) )
print res
self.failUnless( res == "this10.020202020202020202020202020202020" )
# CALLGRAPH
################
# nested nodes are containers that do not show as they do not do anything
# they are just containers after all and should yield the same result if
# compared to the unwrapped workflow
miwfl = workflows.multiinput
miwfl.makeTarget( unicode( "this" ) )
self.failUnless( miwfl._callgraph.number_of_nodes() == wfl._callgraph.number_of_nodes() )
# NESTED WFLS AND PLANS
########################
#print wfl._callgraph.nodes()
plan = wfl.getReportInstance( Plan )
lines = plan.getReport( headline = "WRAPPED WORKFLOW" )
# MULTI-NESTED WORKFLOW
########################
# Two wrapped workflows combined
mwfl = workflows.multiWorkflow
# iterate it - nodes should be facaded and you should not get inside
def test_plan( self ):
miwfl = workflows.multiinput
# try as real target - stil very simple
res = miwfl.makeTarget( unicode( "this" ) )
plan = miwfl.createReportInstance( Plan )
r = plan.makeReport( headline = "unicode workflow test" )
self.failUnless( len( r ) == 6 )
for l in r:
print l
from mrv.automation.report import Plan
cg = scwfl._callgraph
self.failUnless( len( cg.nodes() ) == 2 )
self.failUnless( len( cg.edges() ) == 1 )
# INPUT REQUIRED - multiple nodes
###############################
res = scwfl.makeTarget( 2.0 )
cg = scwfl._callgraph
self.failUnless( len( cg.nodes() ) == 2 )
self.failUnless( len( cg.edges() ) == 1 )
miwfl = workflows.multiinput
res = miwfl.makeTarget( unicode( "this" ) )
cg = miwfl._callgraph
self.failUnless( len( cg.nodes() ) == 5 )
self.failUnless( len( cg.edges() ) == 4 )
self.failUnless( len( list( wfl.iterNodes() ) ) == 1 )
rate, process = wfl.getTargetRating( unicode( "this" ) )
self.failUnless( rate != 0 )
# shuold be able to provide exactly the same output the workflow itself
res = wfl.makeTarget( unicode( "this" ) )
print res
self.failUnless( res == "this10.020202020202020202020202020202020" )
# CALLGRAPH
################
# nested nodes are containers that do not show as they do not do anything
# they are just containers after all and should yield the same result if
# compared to the unwrapped workflow
miwfl = workflows.multiinput
miwfl.makeTarget( unicode( "this" ) )
self.failUnless( miwfl._callgraph.number_of_nodes() == wfl._callgraph.number_of_nodes() )
# NESTED WFLS AND PLANS
########################
#print wfl._callgraph.nodes()
plan = wfl.getReportInstance( Plan )
lines = plan.getReport( headline = "WRAPPED WORKFLOW" )
# MULTI-NESTED WORKFLOW
########################
# Two wrapped workflows combined
mwfl = workflows.multiWorkflow
# iterate it - nodes should be facaded and you should not get inside
def test_workflowProcess( self ):
wfl = workflows.workflowwrap
workflows.multiinput.writeDot(tempfile.gettempdir() + "/mygraph.dot" )
self.failUnless( len( list( wfl.iterNodes() ) ) == 1 )
rate, process = wfl.targetRating( unicode( "this" ) )
self.failUnless( rate != 0 )
# shuold be able to provide exactly the same output the workflow itself
res = wfl.makeTarget( unicode( "this" ) )
print res
self.failUnless( res == "this10.020202020202020202020202020202020" )
# CALLGRAPH
################
# nested nodes are containers that do not show as they do not do anything
# they are just containers after all and should yield the same result if
# compared to the unwrapped workflow
miwfl = workflows.multiinput
def test_workflowProcess( self ):
wfl = workflows.workflowwrap
workflows.multiinput.writeDot(tempfile.gettempdir() + "/mygraph.dot" )
self.failUnless( len( list( wfl.iterNodes() ) ) == 1 )
rate, process = wfl.getTargetRating( unicode( "this" ) )
self.failUnless( rate != 0 )
# shuold be able to provide exactly the same output the workflow itself
res = wfl.makeTarget( unicode( "this" ) )
print res
self.failUnless( res == "this10.020202020202020202020202020202020" )
# CALLGRAPH
################
# nested nodes are containers that do not show as they do not do anything
# they are just containers after all and should yield the same result if
# compared to the unwrapped workflow
miwfl = workflows.multiinput
def test_plan( self ):
miwfl = workflows.multiinput
# try as real target - stil very simple
res = miwfl.makeTarget( unicode( "this" ) )
plan = miwfl.getReportInstance( Plan )
r = plan.getReport( headline = "unicode workflow test" )
self.failUnless( len( r ) == 6 )
for l in r:
print l
def test_workflowProcess( self ):
"""byronimo.automation.process: check workflow nested into process"""
wfl = workflows.workflowwrap
workflows.multiinput.writeDot("/usr/tmp/mygraph.dot" )
self.failUnless( len( list( wfl.iterNodes() ) ) == 1 )
rate, process = wfl.getTargetRating( unicode( "this" ) )
self.failUnless( rate != 0 )
# shuold be able to provide exactly the same output the workflow itself
res = wfl.makeTarget( unicode( "this" ) )
print res
self.failUnless( res == "this10.020202020202020202020202020202020" )
# CALLGRAPH
################
# nested nodes are containers that do not show as they do not do anything
# they are just containers after all and should yield the same result if
# compared to the unwrapped workflow
miwfl = workflows.multiinput