2024-05-26 22:39:55 +03:00
|
|
|
from typing import Callable
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
from libbot._utils import supports_argument
|
|
|
|
|
|
|
|
|
|
|
|
def func1(foo: str, bar: str):
|
2024-10-30 00:19:52 +02:00
|
|
|
"""Dummy function with specific arguments"""
|
2024-05-26 22:39:55 +03:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def func2(foo: str):
|
2024-10-30 00:19:52 +02:00
|
|
|
"""Dummy function with specific arguments"""
|
2024-05-26 22:39:55 +03:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
"func, arg_name, result",
|
|
|
|
[
|
|
|
|
(func1, "foo", True),
|
|
|
|
(func2, "bar", False),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_supports_argument(func: Callable, arg_name: str, result: bool):
|
|
|
|
assert supports_argument(func, arg_name) == result
|