Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
workflow
pypushflow
Commits
80f6eea6
Commit
80f6eea6
authored
Apr 07, 2020
by
payno
Browse files
[ci][TestNodeExecution] add a case to manage Node from script name which contains a run function.
Add also some documentation
parent
030ee583
Changes
1
Hide whitespace changes
Inline
Side-by-side
pypushflow/test/test_representation.py
View file @
80f6eea6
...
...
@@ -75,23 +75,33 @@ class TestScheme(unittest.TestCase):
class
TestNodeExecution
(
unittest
.
TestCase
):
"""Insure Node.execute works"""
def
testCase1
(
self
):
'test that a specific function from her name can be executed'
node
=
Node
(
processing_pt
=
'pypushflow.test.utils.test_function'
)
res
=
node
.
execute
(
node
.
process_pt
,
properties
=
{},
input_name
=
'data'
,
input_data
=
{
'data'
:
0
})
self
.
assertEqual
(
res
,
{
'data'
:
2
})
def
testCase2
(
self
):
'test that an callable class can be executed from her name'
node
=
Node
(
processing_pt
=
'pypushflow.test.utils.ProcessingClass1'
)
res
=
node
.
execute
(
node
.
process_pt
,
properties
=
{},
input_name
=
'data'
,
input_data
=
{
'data'
:
0
})
self
.
assertEqual
(
res
,
{
'data'
:
4
})
def
testCase3
(
self
):
"""Test that a class with handler can be executed"""
node
=
Node
(
processing_pt
=
'pypushflow.test.utils.ProcessingClass2'
)
res
=
node
.
execute
(
node
.
process_pt
,
properties
=
{},
input_name
=
'data'
,
input_data
=
{
'data'
:
0
})
self
.
assertEqual
(
res
,
{
'data'
:
1
})
def
testCase4
(
self
):
script
=
'pypushflow.test.pythonActorTest.run'
node
=
Node
(
processing_pt
=
script
)
res
=
node
.
execute
(
node
.
process_pt
,
properties
=
{},
input_name
=
'data'
,
input_data
=
'pythonActorTest'
)
self
.
assertEqual
(
res
,
{
'reply'
:
'Hello pythonActorTest!'
})
def
suite
():
test_suite
=
unittest
.
TestSuite
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment