Exemplo n.º 1
0
 "classname, params, args, kwargs, expected",
 [
     param("Empty", {}, [], {}, Empty(), id="Empty"),
     param(
         "UntypedArg", {"param": 11}, [], {}, UntypedArg(param=11), id="UntypedArg"
     ),
     param(
         "UntypedArg",
         {},
         [],
         {"param": LibraryClass()},
         UntypedArg(param=LibraryClass()),
         id="UntypedArg_passthrough_lib_class",
     ),
     param("IntArg", {"param": 1}, [], {}, IntArg(param=1), id="IntArg"),
     param("UnionArg", {"param": 1}, [], {}, UnionArg(param=1), id="UnionArg"),
     param("UnionArg", {"param": 3.14}, [], {}, UnionArg(param=3.14), id="UnionArg"),
     # This is okay because Union is not supported and is treated as Any
     param(
         "UnionArg",
         {"param": "str"},
         [],
         {},
         UnionArg(param="str"),
         id="UnionArg:illegal_but_ok_arg",
     ),
     param(
         "WithLibraryClassArg",
         {"num": 10},
         [],
         {"param": LibraryClass()},
Exemplo n.º 2
0
 [
     param("Empty", {}, [], {}, Empty(), id="Empty"),
     param("UntypedArg", {"param": 11}, [], {},
           UntypedArg(param=11),
           id="UntypedArg"),
     param(
         "UntypedArg",
         {},
         [],
         {"param": LibraryClass()},
         UntypedArg(param=LibraryClass()),
         id="UntypedArg_passthrough_lib_class",
     ),
     param("IntArg", {"param": 1}, [], {}, IntArg(param=1), id="IntArg"),
     param("UnionArg", {"param": 1}, [], {},
           UnionArg(param=1),
           id="UnionArg"),
     param("UnionArg", {"param": 3.14}, [], {},
           UnionArg(param=3.14),
           id="UnionArg"),
     # This is okay because Union is not supported and is treated as Any
     param(
         "UnionArg",
         {"param": "str"},
         [],
         {},
         UnionArg(param="str"),
         id="UnionArg:illegal_but_ok_arg",
     ),
     param(
         "WithLibraryClassArg",
Exemplo n.º 3
0
 [
     param("Empty", {}, [], {}, Empty(), id="Empty"),
     param("UntypedArg", {"param": 11}, [], {},
           UntypedArg(param=11),
           id="UntypedArg"),
     param(
         "UntypedArg",
         {},
         [],
         {"param": LibraryClass()},
         UntypedArg(param=LibraryClass()),
         id="UntypedArg_passthrough_lib_class",
     ),
     param("IntArg", {"param": 1}, [], {}, IntArg(param=1), id="IntArg"),
     param("UnionArg", {"param": 1}, [], {},
           UnionArg(param=1),
           id="UnionArg"),
     param("UnionArg", {"param": 3.14}, [], {},
           UnionArg(param=3.14),
           id="UnionArg"),
     # This is okay because Union is not supported and is treated as Any
     param(
         "UnionArg",
         {"param": "str"},
         [],
         {},
         UnionArg(param="str"),  # type: ignore
         id="UnionArg:illegal_but_ok_arg",
     ),
     param(
         "WithLibraryClassArg",