Beispiel #1
0
def test_function_type_inference():
    expected = (Number, str)
    inferred = adapter.infer(format_number)
    assert inferred == expected
    assert isinstance(inferred, adapter.Adaptation)
Beispiel #2
0
def test_callable_type_inference(numformatter):
    expected = (Number, str)
    inferred = adapter.infer(numformatter)
    assert inferred == expected
    assert isinstance(inferred, adapter.Adaptation)
Beispiel #3
0
def test_method_type_inference(numformatter):
    expected = (Number, str)
    inferred = adapter.infer(numformatter.percentage)
    assert inferred == expected
    assert isinstance(inferred, adapter.Adaptation)
Beispiel #4
0
def test_class_type_inference():
    expected = (str, StringIO)
    inferred = adapter.infer(StringIO)
    assert inferred == expected
    assert isinstance(inferred, adapter.Adaptation)