python func validation ok.

This commit is contained in:
2026-02-15 15:50:10 +01:00
parent 1da1b2f9fd
commit 02f93df1d5
6 changed files with 150 additions and 142 deletions

View File

@@ -1,73 +1,61 @@
- let:
name: func test constants,
values:
test parameter: test parameter
- py_func:
name: pass func
key: $(test)_PASS
file: $(test_path)$(psep)func.py
func_name: assertparam
param:
- true
- py_func:
name: fail func
- lua_func:
name: fail lua_func
key: $(test)_FAIL
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: assertparam
param:
- false
- py_func:
name: fail func with expected result "FAIL"
- lua_func:
name: fail lua_func with expected result FAIL
key: $(test)_PASS
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: assertparam
param:
- false
expected_result: FAIL
- py_func:
name: pass func with expected result FAIL
- lua_func:
name: pass lua_func with expected result FAIL
key: $(test)_FAIL
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: assertparam
param:
- true
expected_result: FAIL
- py_func:
- lua_func:
name: expected -1
key: $(test)_PASS
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: echo
param:
- -1
expected_result: -1
- py_func:
- lua_func:
name: expected eval
key: $(test)_PASS
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: echo
param:
- -1
expected_result: "354848436 - 354848437"
- py_func:
- lua_func:
name: expected table
key: $(test)_PASS
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: echo
param:
- [-1, a, {toto: tata}]
expected_result: "[-1, 'a', {'toto': 'tata'}]"
- py_func:
name: global param func
- lua_func:
name: global param lua_func
key: $(test)_PASS
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: checkglobal
param:
- $(test parameter)
@@ -76,50 +64,50 @@
name: python2func
key: $(test)_PASS
values:
- py: $(test_path)$(psep)func.py
- py: $(test_path)$(psep)lua_func.lua
- py_func:
name: global param func
- lua_func:
name: global param lua_func
key: $(test)_PASS
file: $(py)
func_name: checkglobal
param:
- $(test parameter)
- py_func:
- lua_func:
name: skipped_checkglobal
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: should_not_be_called
param:
- $(test parameter)
- py_func:
- lua_func:
name: skipped true
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: checkglobal
skipped: true
param:
- $(test parameter)
- py_func:
- lua_func:
name: skipped true
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: checkglobal
skipped: true
param:
- $(test parameter)
- py_func:
- lua_func:
name: skipped 1
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: checkglobal
skipped: 1
param:
- $(test parameter)
- py_func:
- lua_func:
name: FunctionItem test
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: ValidationTest
param:
- $(test parameter)
@@ -130,54 +118,54 @@
- group:
name: Function result failure
steps:
- py_func:
- lua_func:
name: int failure
key: $(test)_FAIL
file: $(test_path)$(psep)func.py
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
func_name: echo
param: [-1]
- py_func:
- lua_func:
name: float failure
key: $(test)_FAIL
file: $(test_path)$(psep)func.py
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
func_name: echo
param: [-1.3]
- py_func:
- lua_func:
name: String failure
key: $(test)_FAIL
file: $(test_path)$(psep)func.py
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
func_name: echo
param: [ "FAIL" ]
- py_func:
- lua_func:
name: Tuple int,str failure
key: $(test)_FAIL
file: $(test_path)$(psep)func.py
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
func_name: tuple_return
param: [ -1, "Got a failure" ]
- group:
name: Functions result success
steps:
- py_func:
- lua_func:
name: int success
key: $(test)_PASS
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: echo
param: [0]
- py_func:
- lua_func:
name: float success
key: $(test)_PASS
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: echo
param: [0.3]
- py_func:
- lua_func:
name: String success
key: $(test)_PASS
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: echo
param: [ "Something that is not only strictly FAIL" ]
- py_func:
- lua_func:
name: Tuple int,str success
key: $(test)_PASS
file: $(test_path)$(psep)func.py
file: $(test_path)$(psep)lua_func.lua
func_name: tuple_return
param: [ 0, "OK" ]

View File

@@ -16,6 +16,9 @@ def checkglobal(param):
assert param=='test parameter'
return 0
def checkglobal2():
return tm.gd("py_func test parameter")
def should_not_be_called(param):
raise

View File

@@ -1,179 +1,191 @@
- let:
name: py_func test constants,
values:
py_func test parameter: test parameter
- lua_func:
name: pass lua_func
- py_func:
name: pass py_func
key: $(test)_PASS
file: lua_func.lua
func_name: func_to_be_executed
file: $(test_path)$(psep)py_func.py
func_name: assertparam
param:
- true
- lua_func:
name: fail lua_func
- py_func:
name: fail py_func
key: $(test)_FAIL
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: assertparam
param:
- false
- lua_func:
name: fail lua_func with expected result FAIL
- py_func:
name: fail py_func with expected result "FAIL"
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: assertparam
param:
- false
expected_result: FAIL
- lua_func:
name: pass lua_func with expected result FAIL
- py_func:
name: pass py_func with expected result FAIL
key: $(test)_FAIL
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: assertparam
param:
- true
expected_result: FAIL
- lua_func:
- py_func:
name: expected -1
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: echo
param:
- -1
expected_result: -1
- lua_func:
- py_func:
name: expected eval
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: echo
param:
- -1
expected_result: "354848436 - 354848437"
- lua_func:
- py_func:
name: expected table
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: echo
param:
- [-1, a, {toto: tata}]
expected_result: "[-1, 'a', {'toto': 'tata'}]"
- lua_func:
name: global param lua_func
- py_func:
name: global param py_func
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: checkglobal
param:
- $(test parameter)
- $(py_func test parameter)
- let:
name: python2func
key: $(test)_PASS
values:
- py: $(test_path)$(psep)lua_func.lua
- py: $(test_path)$(psep)py_func.py
- lua_func:
name: global param lua_func
- py_func:
name: global param py_func 2
key: $(test)_PASS
file: $(py)
func_name: checkglobal2
expected_result: $(py_func test parameter)
- py_func:
name: global param py_func
key: $(test)_PASS
file: $(py)
func_name: checkglobal
param:
- $(test parameter)
- $(py_func test parameter)
- lua_func:
- py_func:
name: skipped_checkglobal
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: should_not_be_called
param:
- $(test parameter)
- $(py_func test parameter)
- lua_func:
- py_func:
name: skipped true
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: checkglobal
skipped: true
param:
- $(test parameter)
- $(py_func test parameter)
- lua_func:
name: skipped true
file: $(test_path)$(psep)lua_func.lua
func_name: checkglobal
skipped: true
param:
- $(test parameter)
- lua_func:
- py_func:
name: skipped 1
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: checkglobal
skipped: 1
param:
- $(test parameter)
- $(py_func test parameter)
- lua_func:
- py_func:
name: FunctionItem test
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: ValidationTest
param:
- $(test parameter)
- $(py_func test parameter)
- group:
name: Function results check
steps:
- group:
name: Function result failure
name: Function result 1
steps:
- lua_func:
- py_func:
name: int failure
key: $(test)_FAIL
file: $(test_path)$(psep)lua_func.lua
key: $(test)_PASS
file: $(test_path)$(psep)py_func.py
func_name: echo
param: [-1]
- lua_func:
expected_result: -1
- py_func:
name: float failure
key: $(test)_FAIL
file: $(test_path)$(psep)lua_func.lua
key: $(test)_PASS
file: $(test_path)$(psep)py_func.py
func_name: echo
param: [-1.3]
- lua_func:
expected_result: -1.3
- py_func:
name: String failure
key: $(test)_FAIL
file: $(test_path)$(psep)lua_func.lua
key: $(test)_PASS
file: $(test_path)$(psep)py_func.py
func_name: echo
param: [ "FAIL" ]
- lua_func:
expected_result: FAIL
- py_func:
name: Tuple int,str failure
key: $(test)_FAIL
file: $(test_path)$(psep)lua_func.lua
key: $(test)_PASS
file: $(test_path)$(psep)py_func.py
func_name: tuple_return
param: [ -1, "Got a failure" ]
expected_result: [-1, "Got a failure"]
- group:
name: Functions result success
name: Functions result 2
steps:
- lua_func:
- py_func:
name: int success
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: echo
param: [0]
- lua_func:
expected_result: 0
- py_func:
name: float success
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: echo
param: [0.3]
- lua_func:
expected_result: 0.3
- py_func:
name: String success
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: echo
param: [ "Something that is not only strictly FAIL" ]
- lua_func:
expected_result: Something that is not only strictly FAIL
- py_func:
name: Tuple int,str success
key: $(test)_PASS
file: $(test_path)$(psep)lua_func.lua
file: $(test_path)$(psep)py_func.py
func_name: tuple_return
param: [ 0, "OK" ]
expected_result: [0, "OK"]