create an is_callable method for all representation objects, to determine if something is callable or not

This commit is contained in:
Dave Halter
2014-04-02 09:42:15 +02:00
parent d1a6dd1098
commit 305b593f3b
5 changed files with 35 additions and 9 deletions

View File

@@ -206,12 +206,11 @@ def test_signature_is_definition():
def test_no_signature():
# str doesn't have a __call__ method
assert Script('str()(').call_signatures == []
assert Script('str()(').call_signatures() == []
s = dedent("""\
class X():
pass
X()(
""")
assert Script(s).call_signatures == []
assert len(Script(s, column=2).call_signatures) == 1
X()(""")
assert Script(s).call_signatures() == []
assert len(Script(s, column=2).call_signatures()) == 1