pythonActorDiamondTest.py 1.04 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
def run_incrementation(a=None, increment_value=None, **kwargs):

    if a is None:
        raise RuntimeError("Missing argument 'a'!")
    if increment_value is None:
        raise RuntimeError("Missing argument 'increment_value'!")
    return {
        "a": a + increment_value,
        "b": increment_value
    }


def no_processing(a=None, b=None, c=None, d=None, **kwargs):
    print("receive a: {}, b: {} c: {}, d: {}".format(a, b, c, d))
    return {
        "a": d,
        "b": b,
        "c": c,
        "d": d,
    }


def pass_a(a=None, **kwargs):
    if a is None:
        raise RuntimeError("Missing argument 'value'!")
    return {
        "a": a,
    }


def move_d_to_a(a=None, b=None, c=None, d=None):
    if a is None:
        raise RuntimeError("Missing argument 'a'!")
    if b is None:
        raise RuntimeError("Missing argument 'b'!")
    if c is None:
        raise RuntimeError("Missing argument 'c'!")
    if d is None:
        raise RuntimeError("Missing argument 'd'!")

    return {
        "a": d,
        "b": b,
        "c": c,
    }