()
| 65 | |
| 66 | |
| 67 | def test_wrap(): |
| 68 | @validate_arguments |
| 69 | def foo_bar(a: int, b: int): |
| 70 | """This is the foo_bar method.""" |
| 71 | return f'{a}, {b}' |
| 72 | |
| 73 | assert foo_bar.__doc__ == 'This is the foo_bar method.' |
| 74 | assert foo_bar.__name__ == 'foo_bar' |
| 75 | assert foo_bar.__module__ == 'tests.test_deprecated_validate_arguments' |
| 76 | assert foo_bar.__qualname__ == 'test_wrap.<locals>.foo_bar' |
| 77 | assert isinstance(foo_bar.vd, ValidatedFunction) |
| 78 | assert callable(foo_bar.raw_function) |
| 79 | assert foo_bar.vd.arg_mapping == {0: 'a', 1: 'b'} |
| 80 | assert foo_bar.vd.positional_only_args == set() |
| 81 | assert issubclass(foo_bar.model, BaseModel) |
| 82 | assert foo_bar.model.model_fields.keys() == {'a', 'b', 'args', 'kwargs', 'v__duplicate_kwargs'} |
| 83 | assert foo_bar.model.__name__ == 'FooBar' |
| 84 | assert foo_bar.model.model_json_schema()['title'] == 'FooBar' |
| 85 | assert repr(inspect.signature(foo_bar)) == '<Signature (a: int, b: int)>' |
| 86 | |
| 87 | |
| 88 | def test_kwargs(): |
nothing calls this directly
no test coverage detected