[py-svn] r33055 - py/branch/apigen/py/test/tracer/testing

fijal at codespeak.net fijal at codespeak.net
Mon Oct 9 15:41:31 CEST 2006


Author: fijal
Date: Mon Oct  9 15:41:30 2006
New Revision: 33055

Added:
   py/branch/apigen/py/test/tracer/testing/__init__.py   (contents, props changed)
   py/branch/apigen/py/test/tracer/testing/test_rest.py   (contents, props changed)
Log:
Added two missing files.


Added: py/branch/apigen/py/test/tracer/testing/__init__.py
==============================================================================

Added: py/branch/apigen/py/test/tracer/testing/test_rest.py
==============================================================================
--- (empty file)
+++ py/branch/apigen/py/test/tracer/testing/test_rest.py	Mon Oct  9 15:41:30 2006
@@ -0,0 +1,35 @@
+
+""" tests document generation
+"""
+
+from py.__.test.tracer.genrest import ViewVC, RestGen
+from py.__.test.tracer.tracer import DocStorage, Tracer
+
+from StringIO import StringIO
+
+def test_links():
+    vcview = ViewVC("http://codespeak.net/viewvc/")
+    linkname = vcview.getlink(__file__, 0)
+    assert linkname == 'http://codespeak.net/viewvc/py/test/'\
+        'tracer/testing/test_rest.py?view=markup'
+
+def fun(a, b, c):
+    "Some docstring"
+    return "d"
+
+def test_generation():
+    descs = {"fun":fun}
+    ds = DocStorage().from_dict(descs)
+    lg = ViewVC("http://codespeak.net/viewvc/")
+    t = Tracer(ds)
+    t.start_tracing()
+    fun(1, ("g", 3), 8)
+    fun(2., ("a", 1.), "a")
+    t.end_tracing()
+    s = StringIO()
+    r = RestGen(ds, lg, output=s)
+    r.write()
+    # we cannot check the source, cause the rapidly changing
+    # visual effect will break it, so we'll make assertion later
+    # XXX: do that
+    assert s.getvalue()


More information about the py-svn mailing list