Пример #1
0
def test_transmute_mapping_subscripted(annotation, value):
    annotation = resolve_supertype(annotation)
    key_arg, value_arg = annotation.__args__
    transmuted = transmute(annotation, value)
    assert isinstance(transmuted, annotation.__origin__)
    assert all(isinstance(x, get_origin(key_arg)) for x in transmuted.keys())
    assert all(isinstance(x, get_origin(value_arg)) for x in transmuted.values())
Пример #2
0
def test_get_origin_returns_origin(annotation, origin):
    detected = get_origin(annotation)
    assert detected is origin
Пример #3
0
def test_get_origin(annotation, origin):
    assert get_origin(annotation) is origin