コード例 #1
0
ファイル: test_apidoc.py プロジェクト: b10n1k/build-relengapi
def test_typereference_unknown():
    """typereference should describe an unkonwn object with its name"""
    eq_(apidoc.typereference(complex), 'complex')
コード例 #2
0
ファイル: test_apidoc.py プロジェクト: b10n1k/build-relengapi
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`')
コード例 #3
0
ファイル: test_apidoc.py プロジェクト: b10n1k/build-relengapi
def test_typereference_array():
    """typereference should describe a list as [<type>]"""
    eq_(apidoc.typereference(wsme.types.ArrayType(int)), '[int]')
コード例 #4
0
ファイル: test_apidoc.py プロジェクト: b10n1k/build-relengapi
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}')
コード例 #5
0
ファイル: test_apidoc.py プロジェクト: b10n1k/build-relengapi
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}')
コード例 #6
0
ファイル: test_apidoc.py プロジェクト: b10n1k/build-relengapi
def test_typereference_UserType():
    """typereference should return the name of a UserType"""
    eq_(apidoc.typereference(wsme.types.binary), 'binary')