[Epydoc-commits] SF.net SVN: epydoc: [1536] trunk/epydoc/src/epydoc/test
Brought to you by:
edloper
From: <dva...@us...> - 2007-02-19 23:00:03
|
Revision: 1536 http://svn.sourceforge.net/epydoc/?rev=1536&view=rev Author: dvarrazzo Date: 2007-02-19 14:59:58 -0800 (Mon, 19 Feb 2007) Log Message: ----------- - Fixed docstrings so they correctly link to the Epydoc API. Currently it is required to use `register_canonical_role()` instead of `register_local_role()` in `xlink.create_api_role()` Modified Paths: -------------- trunk/epydoc/src/epydoc/test/apidoc.doctest trunk/epydoc/src/epydoc/test/docbuilder.doctest trunk/epydoc/src/epydoc/test/docintrospecter.doctest trunk/epydoc/src/epydoc/test/docparser.doctest trunk/epydoc/src/epydoc/test/pyval_repr.doctest trunk/epydoc/src/epydoc/test/zope2.doctest trunk/epydoc/src/epydoc/test/zope3.doctest Modified: trunk/epydoc/src/epydoc/test/apidoc.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/apidoc.doctest 2007-02-19 22:55:22 UTC (rev 1535) +++ trunk/epydoc/src/epydoc/test/apidoc.doctest 2007-02-19 22:59:58 UTC (rev 1536) @@ -2,7 +2,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file serves to provide both documentation and regression tests for the epydoc.apidoc module. The main purpose of this module is to -define the `APIDoc` class hierarchy, which is used to encode API +define the :epydoc:`APIDoc` class hierarchy, which is used to encode API documentation about Python programs. The API documentation for a Python program is encoded using a graph of `APIDoc` objects, each of which encodes information about a single Python variable or value. Modified: trunk/epydoc/src/epydoc/test/docbuilder.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/docbuilder.doctest 2007-02-19 22:55:22 UTC (rev 1535) +++ trunk/epydoc/src/epydoc/test/docbuilder.doctest 2007-02-19 22:59:58 UTC (rev 1536) @@ -338,9 +338,9 @@ =================== When we do both parsing & introspection, and merge the result, we should trust the introspected APIDoc's is_imported value more than the -parsed APIDoc. In particular, in the following example, `x` should +parsed APIDoc. In particular, in the following example, ``x`` should have `is_imported=True`. But if we can't tell from introspection, -then use parse info -- so `y` should be imported, but `z` should not. +then use parse info -- so ``y`` should be imported, but ``z`` should not. >>> import epydoc.docintrospecter >>> epydoc.docintrospecter.clear_cache() Modified: trunk/epydoc/src/epydoc/test/docintrospecter.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/docintrospecter.doctest 2007-02-19 22:55:22 UTC (rev 1535) +++ trunk/epydoc/src/epydoc/test/docintrospecter.doctest 2007-02-19 22:59:58 UTC (rev 1536) @@ -2,16 +2,16 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `epydoc.docintrospecter` module is used to extract API documentation by introspecting Python objects directy. Its primary interface is -`introspect_docs()`, which takes a Python object, and returns a +`docintrospecter.introspect_docs()`, which takes a Python object, and returns a `ValueDoc` describing that value. Test Function ============= This test function takes a string containing the contents of a module. It writes the string contents to a file, imports the file as a module, -and uses `introspect_docs` to introspect it, and pretty prints the resulting -ModuleDoc object. The `attribs` argument specifies which attributes -of the `APIDoc`s should be displayed. The `introspect` argument gives the +and uses `docintrospecter.introspect_docs` to introspect it, and pretty prints the resulting +`ModuleDoc` object. The ``attribs`` argument specifies which attributes +of the `APIDoc`s should be displayed. The ``introspect`` argument gives the name of a variable in the module whose value should be introspected, instead of introspecting the whole module. @@ -43,7 +43,7 @@ +- x => VariableDoc for epydoc_test.x [5] +- y => VariableDoc for epydoc_test.y [6] -If two variables share the same value, then their `VariableDoc`s will +If two variables share the same value, then their `VariableDoc`\ s will share a `ValueDoc`: >>> runintrospecter(s=""" @@ -143,8 +143,8 @@ Variable Docstrings =================== -The DocIntrospecter is unable extract docstrings for variables. These -docstrings can only be detected if the DocParser is used. +The `docintrospecter` is unable extract docstrings for variables. These +docstrings can only be detected if the `docparser` is used. >>> runintrospecter(s=""" ... x = 12 @@ -188,12 +188,12 @@ +- pyval = <function f at ...> +- vararg = None -The function's arguments are described by the properties `posargs`, -`posarg_defaults`, `kwarg`, and `vararg`. `posargs` is a list of +The function's arguments are described by the properties ``posargs``, +``posarg_defaults``, ``kwarg``, and ``vararg``. ``posargs`` is a list of argument names (or nested tuples of names, for tuple-unpacking args). -`posarg_defaults` is a list of `ValueDoc`s for default values, -corresponding 1:1 with `posargs`. `posarg_defaults` is None for -arguments with no default value. `vararg` and `kwarg` are the names +``posarg_defaults`` is a list of `ValueDoc`\ s for default values, +corresponding 1:1 with ``posargs``. ``posarg_defaults`` is None for +arguments with no default value. ``vararg`` and ``kwarg`` are the names of the variable argument and keyword argument, respectively: >>> runintrospecter(s=""" @@ -388,7 +388,7 @@ +- value +- GenericValueDoc [2] -The right-hand side of a `del` statement may contain a nested +The right-hand side of a ``del`` statement may contain a nested combination of lists, tuples, and parenthases. All variables found anywhere in this nested structure should be deleted: @@ -424,7 +424,7 @@ +- variables +- g => VariableDoc for epydoc_test.g [1] -The right-hand side of a `del` statement may contain a dotted name, in +The right-hand side of a ``del`` statement may contain a dotted name, in which case the named variable should be deleted from its containing namespace. @@ -595,10 +595,10 @@ SF Bug [ 1657050 ] Builtins not resolved in "os" ------------------------------------------------ -If a variable is listed in __all__, then we need to introspect it, +If a variable is listed in ``__all__``, then we need to introspect it, even if we know for certain that it's imported. Before this bug -was fixed, the following test generated a generic 'ValueDoc' value -instead of a 'RoutineDoc' value, because it didn't introspect the +was fixed, the following test generated a generic `ValueDoc` value +instead of a `RoutineDoc` value, because it didn't introspect the value of getcwd. >>> x = runintrospecter(s=""" Modified: trunk/epydoc/src/epydoc/test/docparser.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/docparser.doctest 2007-02-19 22:55:22 UTC (rev 1535) +++ trunk/epydoc/src/epydoc/test/docparser.doctest 2007-02-19 22:59:58 UTC (rev 1536) @@ -2,16 +2,16 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `epydoc.docparser` module is used to extract API documentation by parsing the source code of Python files. Its primary interface is -`parse_docs()`, which takes a module's filename, and returns a +`docparser.parse_docs()`, which takes a module's filename, and returns a ModuleDoc describing that module and its contents. Test Function ============= This test function takes a string containing the contents of a module, -and writes it to a file, uses `parse_docs` to parse it, and pretty -prints the resulting ModuleDoc object. The `attribs` argument +and writes it to a file, uses `docparser.parse_docs()` to parse it, and pretty +prints the resulting ModuleDoc object. The ``attribs`` argument specifies which attributes of the `APIDoc`s should be displayed. The -`show` argument, if specifies, gives the name of the object in the +``show`` argument, if specifies, gives the name of the object in the module that should be displayed (but the whole module will always be inspected; this just selects what to display). @@ -27,7 +27,7 @@ loops, while loops, and try/except/finally blocks. Tuple assignments are unpacked, when possible. -For simple variable assignments, DocParser creates VariableDoc objects +For simple variable assignments, DocParser creates `VariableDoc` objects containing the name; a valuedoc with the value (as both an abstract syntax tree and a string representation); and information about whether we think the value was imported; is an alias; and is an @@ -424,12 +424,12 @@ +- posargs = [u'x'] +- vararg = None -The function's arguments are described by the properties `posargs`, -`posarg_defaults`, `kwarg`, and `vararg`. `posargs` is a list of +The function's arguments are described by the properties ``posargs``, +``posarg_defaults``, ``kwarg``, and ``vararg``. ``posargs`` is a list of argument names (or nested tuples of names, for tuple-unpacking args). -`posarg_defaults` is a list of `ValueDoc`s for default values, -corresponding 1:1 with `posargs`. `posarg_defaults` is None for -arguments with no default value. `vararg` and `kwarg` are the names +``posarg_defaults`` is a list of `ValueDoc`\ s for default values, +corresponding 1:1 with ``posargs``. ``posarg_defaults`` is None for +arguments with no default value. ``vararg`` and ``kwarg`` are the names of the variable argument and keyword argument, respectively: >>> runparser(s=""" @@ -587,7 +587,7 @@ +- GenericValueDoc [2] +- parse_repr = u'12' -The right-hand side of a `del` statement may contain a nested +The right-hand side of a ``del`` statement may contain a nested combination of lists, tuples, and parenthases. All variables found anywhere in this nested structure should be deleted: @@ -623,7 +623,7 @@ +- variables +- g => VariableDoc for epydoc_test.g [1] -The right-hand side of a `del` statement may contain a dotted name, in +The right-hand side of a ``del`` statement may contain a dotted name, in which case the named variable should be deleted from its containing namespace. Modified: trunk/epydoc/src/epydoc/test/pyval_repr.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/pyval_repr.doctest 2007-02-19 22:55:22 UTC (rev 1535) +++ trunk/epydoc/src/epydoc/test/pyval_repr.doctest 2007-02-19 22:59:58 UTC (rev 1536) @@ -206,7 +206,7 @@ Line Wrapping ============= If a line goes beyond linelen, it is wrapped using ``↵`` (which -gets translated to ``\\`` by `to_plaintext()`). +gets translated to ``\\`` by `ParsedEpytextDocstring.to_plaintext()`). >>> colorizer = PyvalColorizer(linelen=40) >>> print colorizer.colorize('x'*100).to_plaintext(None) @@ -233,8 +233,8 @@ Representation Scores ===================== When colorized representations are built, a score is computed -evaluating how helpful the repr is. E.g., unhelpful values like `<Foo -instance at 0x12345>` get low scores. Currently, the scoring +evaluating how helpful the repr is. E.g., unhelpful values like ``<Foo +instance at 0x12345>`` get low scores. Currently, the scoring algorithm is: - [+1] for each object colorized. When the colorizer recurses into @@ -244,8 +244,8 @@ - [-100] if repr(obj) raises an exception, for any colorized object (including objects in structures). -The `min_score` arg to colorize can be used to set a cutoff-point for -scores; if the score is too low, then `colorize` will return `None`. +The ``min_score`` arg to colorize can be used to set a cutoff-point for +scores; if the score is too low, then `PyvalColorizer.colorize` will return ``None``. >>> def color2(v): ... colorizer = PyvalColorizer(linelen=40) Modified: trunk/epydoc/src/epydoc/test/zope2.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/zope2.doctest 2007-02-19 22:55:22 UTC (rev 1535) +++ trunk/epydoc/src/epydoc/test/zope2.doctest 2007-02-19 22:59:58 UTC (rev 1536) @@ -52,6 +52,6 @@ +- RoutineDoc [18] +- pyval = <CMethod object at ...> -(If we didn't add special support, `ExtensionClass` would be a +(If we didn't add special support, ``ExtensionClass`` would be a `GenericValueDoc`.) Modified: trunk/epydoc/src/epydoc/test/zope3.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/zope3.doctest 2007-02-19 22:55:22 UTC (rev 1535) +++ trunk/epydoc/src/epydoc/test/zope3.doctest 2007-02-19 22:59:58 UTC (rev 1536) @@ -23,5 +23,5 @@ +- canonical_name = DottedName('epydoc_test', 'IExample') +- pyval = <InterfaceClass epydoc_test.IExample> -(If we didn't add special support, `IExample` would be a +(If we didn't add special support, ``IExample`` would be a `GenericValueDoc`.) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |