Exemplo n.º 1
0
def test_typereference_unknown():
    """typereference should describe an unkonwn object with its name"""
    eq_(apidoc.typereference(complex), 'complex')
Exemplo n.º 2
0
def test_typereference_complex():
    """typereference should describe a complex type with an ':api:type:' reference"""
    class SomeType(wsme.types.Base):
        id = int

    eq_(apidoc.typereference(SomeType), ':api:type:`SomeType`')
Exemplo n.º 3
0
def test_typereference_array():
    """typereference should describe a list as [<type>]"""
    eq_(apidoc.typereference(wsme.types.ArrayType(int)), '[int]')
Exemplo n.º 4
0
def test_typereference_int_dict():
    """typereference should describe a dictionary with other keys as
    {<type>:<type>}"""
    eq_(apidoc.typereference(
        wsme.types.DictType(int, unicode)), '{int: unicode}')
Exemplo n.º 5
0
def test_typereference_str_dict():
    """typereference should describe a dictionary with string keys as {"...":
        <some type>}"""
    eq_(apidoc.typereference(
        wsme.types.DictType(unicode, int)), '{"...": int}')
Exemplo n.º 6
0
def test_typereference_UserType():
    """typereference should return the name of a UserType"""
    eq_(apidoc.typereference(wsme.types.binary), 'binary')