Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #562 (closed defect: worksforme)

Opened 13 years ago

Last modified 12 years ago

Comment on docs/gettingstarted.html - test code fails

Reported by: nrichards at gmail dot com Owned by: anonymous
Priority: normal Milestone:
Component: Documentation Version:
Severity: normal Keywords:
Cc:

Description

In the Testing... section a test is given using the quickstart welcome kid file. The example test fails. This is confusing for people reading the documentation, trying to learn turbogears.

The test should not fail.

The documentation  http://www.turbogears.org/docs/gettingstarted.html explains the welcome template must contain a special value, but the documentation up to that point has not introduced the reader to the welcome template, nor how to verify that the special value is contained in the template:

The template test assumes that the welcome template contains something like: "The new value is ${newvalue}."

The document should explicitly instruct the reader how to validate / fixup the welcome template, or the quickstart welcome template should be made compatible with this document.

MY SHELL'S TEST RESULTS

$ python setup.py testgears
running testgears
2006/02/11 15:34:15 CONFIG INFO Server parameters:
2006/02/11 15:34:15 CONFIG INFO   server.environment: development
2006/02/11 15:34:15 CONFIG INFO   server.logToScreen: True
2006/02/11 15:34:15 CONFIG INFO   server.logFile:
2006/02/11 15:34:15 CONFIG INFO   server.protocolVersion: HTTP/1.0
2006/02/11 15:34:15 CONFIG INFO   server.socketHost:
2006/02/11 15:34:15 CONFIG INFO   server.socketPort: 8080
2006/02/11 15:34:15 CONFIG INFO   server.socketFile:
2006/02/11 15:34:15 CONFIG INFO   server.reverseDNS: False
2006/02/11 15:34:15 CONFIG INFO   server.socketQueueSize: 5
2006/02/11 15:34:15 CONFIG INFO   server.threadPool: 0
running egg_info
writing requirements to gs.egg-info\requires.txt
writing gs.egg-info\PKG-INFO
writing top-level names to gs.egg-info\top_level.txt
reading manifest file 'gs.egg-info\SOURCES.txt'
writing manifest file 'gs.egg-info\SOURCES.txt'
running build_ext
Tests the output passed through a template (gs.tests.test_controllers) ... 2006/
02/11 15:34:15 HTTP INFO 1 - GET /?value=27 HTTP/1.1
2006-02-11 15:34:15,500 turbogears.view DEBUG Recompiling template for gs.templa
tes.welcome
2006-02-11 15:34:15,578 turbogears.view DEBUG Applying template gs.templates.wel
come
localhost - - [2006/02/11 15:34:15] "GET /?value=27 HTTP/1.1" 200 1582
FAIL
Tests the output of the method without the template (gs.tests.test_controllers)
... FAIL

======================================================================
FAIL: Tests the output passed through a template (gs.tests.test_controllers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\bin\python24\lib\site-packages\testgears-0.2-py2.4.egg\testgears\coll
ector.py", line 26, in runTest
  File "c:\src\web\gs\gs\tests\test_controllers.py", line 10, in test_withtempla
te
    assert "The new value is 54." in cherrypy.response.body[0]
AssertionError

======================================================================
FAIL: Tests the output of the method without the template (gs.tests.test_control
lers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\bin\python24\lib\site-packages\testgears-0.2-py2.4.egg\testgears\coll
ector.py", line 26, in runTest
  File "c:\src\web\gs\gs\tests\test_controllers.py", line 15, in test_directcall

    assert d["newvalue"] == 10
AssertionError

----------------------------------------------------------------------
Ran 2 tests in 0.390s

FAILED (failures=2)

Change History

comment:1 Changed 13 years ago by nrichards at gmail dot com

I think it's not hitting my server at all.

The results do mention 'localhost' but not the port 8080.

comment:2 Changed 13 years ago by nrichards at gmail dot com

OK so this bug should be fixed simply including instruction on how to edit the templates/welcome.kid to include a <p>The new value is ${newvalue}.</p> line somewhere inside it.

The previous comment was my error.

comment:3 Changed 13 years ago by kevin

  • Status changed from new to closed
  • Resolution set to worksforme

At present, at least, the Getting Started Guide says:

    <p>The template test assumes that the welcome template contains something like: "The new value is $${newvalue}."</p>
Note: See TracTickets for help on using tickets.