Esempio n. 1
0
def test_typereference_unknown():
    """typereference should describe an unkonwn object with its name"""
    eq_(apidoc.typereference(complex), 'complex')
Esempio 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`')
Esempio n. 3
0
def test_typereference_array():
    """typereference should describe a list as [<type>]"""
    eq_(apidoc.typereference(wsme.types.ArrayType(int)), '[int]')
Esempio 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}')
Esempio 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}')
Esempio n. 6
0
def test_typereference_UserType():
    """typereference should return the name of a UserType"""
    eq_(apidoc.typereference(wsme.types.binary), 'binary')