Skip to content

Commit 0e53b7b

Browse files
committed
UnitTests: TestExecuteFunctionArgs added sample with **kwargs
1 parent 026fddf commit 0e53b7b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

isc/py/unit/TestCase.cls

+11
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,17 @@ Method TestExecuteFunctionArgs()
431431
set sc = ##class(isc.py.Main).ExecuteFunctionArgs("str.format",,,.result, string, arg1, arg2, arg3, arg4)
432432
do $$$AssertStatusOK(sc, "str.format execution OK")
433433
do $$$AssertEquals(result, "Positional: Hello, World, Alice, Bob", "str.format returned expected string")
434+
435+
436+
kill result
437+
438+
set string = ##class(isc.py.util.Converter).EscapeString("Positional: {0} {1}! Keyword: {name}, {name2}")
439+
set arg1 = ##class(isc.py.util.Converter).EscapeString("Hello")
440+
set arg2 = ##class(isc.py.util.Converter).EscapeString("World")
441+
set kwargs = "**" _ {"name":"Alice","name2":"Bob"}.%ToJSON()
442+
set sc = ##class(isc.py.Main).ExecuteFunctionArgs("str.format",,,.result, string, arg1, arg2, kwargs)
443+
do $$$AssertStatusOK(sc, "str.format execution OK")
444+
do $$$AssertEquals(result, "Positional: Hello World! Keyword: Alice, Bob", "str.format returned expected string")
434445
}
435446

436447
}

0 commit comments

Comments
 (0)