MCPcopy Index your code
hub / github.com/encode/django-rest-framework / test_function

Method test_function

tests/test_fields.py:70–86  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

68 assert not is_simple_callable(Foo().invalid)
69
70 def test_function(self):
71 def simple():
72 pass
73
74 def valid(param='value', param2='value'):
75 pass
76
77 def valid_vargs_kwargs(*args, **kwargs):
78 pass
79
80 def invalid(param, param2='value'):
81 pass
82
83 assert is_simple_callable(simple)
84 assert is_simple_callable(valid)
85 assert is_simple_callable(valid_vargs_kwargs)
86 assert not is_simple_callable(invalid)
87
88 @pytest.mark.parametrize('obj', (True, None, "str", b'bytes', 123, 1.23))
89 def test_not_callable(self, obj):

Callers

nothing calls this directly

Calls 1

is_simple_callableFunction · 0.90

Tested by

no test coverage detected