Ejemplo n.º 1
0
def test_missing_field_str():
    exc = MissingField("x", int, object)
    assert (str(exc) == 'Field "x" of type builtins.int is missing '
            "in builtins.object instance")
Ejemplo n.º 2
0
def test_missing_field_holder_class_name():
    exc = MissingField("x", int, object)
    assert exc.holder_class_name == "builtins.object"
    exc = MissingField("x", int, List[int])
    assert exc.holder_class_name == "typing.List[int]"
Ejemplo n.º 3
0
def test_missing_field_generic_field_type_name():
    exc = MissingField("x", List[int], object)
    assert exc.field_type_name == "typing.List[int]"
Ejemplo n.º 4
0
def test_missing_field_simple_field_type_name():
    exc = MissingField("x", int, object)
    assert exc.field_type_name == "builtins.int"
Ejemplo n.º 5
0
def test_missing_field_holder_class_name():
    exc = MissingField('x', int, object)
    assert exc.holder_class_name == 'builtins.object'
    exc = MissingField('x', int, List[int])
    assert exc.holder_class_name == 'typing.List[int]'
Ejemplo n.º 6
0
def test_missing_field_str():
    exc = MissingField("x", int, object)
    assert str(exc) == 'Field "x" of type int is missing in object instance'