[Zope3-dev] FunctionalDocFileSuite?

Roger Ineichen dev at projekt01.ch
Sat Feb 26 21:00:02 EST 2005


I tried a FunctionalDocFileSuite
The output has no (-) in fornt of the lines.
But the test fails? Any Idea. Is the FunctionalDocFileSuite not able
to check more then one block of content. I have more then one <BLANKLINE>
between the tested blocks of content.

---------------------------------------------------------------------

D:\projektCompiler\trunk>python test.py -s zope\app\demo\widget -f
Configuration file found.
Running FUNCTIONAL tests from D:\projektCompiler\trunk
Parsing ftesting.zcml
Failure in test
D:\projektCompiler\trunk\src\zope\app\demo\widget\ftests\textwidget.txt
Traceback (most recent call last):
  File "D:\projektCompiler\trunk\src\zope\testing\doctest.py", line 2187, in
runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for textwidget.txt
  File
"D:\projektCompiler\trunk\src\zope\app\demo\widget\ftests\textwidget.txt",
line 0

----------------------------------------------------------------------
File
"D:\projektCompiler\trunk\src\zope\app\demo\widget\ftests\textwidget.txt",
line 16, in textwidget.txt
Failed example:
    print http(r"""
    POST /widgets/+/addDemoTextWidget.html HTTP/1.1
    Authorization: Basic mgr:mgrpw
    Content-Type: multipart/form-data;
boundary=---------------------------7d513d22e30f9a
    Referer: http://localhost:8081/widgets/+/addDemoTextWidget.html=
    -----------------------------7d513d22e30f9a
    Content-Disposition: form-data; name="field.standard"

    demotext
    -----------------------------7d513d22e30f9a
    Content-Disposition: form-data; name="field.required"

    demotext
    -----------------------------7d513d22e30f9a
    Content-Disposition: form-data; name="field.constraint"

    constraint
    -----------------------------7d513d22e30f9a
    Content-Disposition: form-data; name="field.default"

    default
    -----------------------------7d513d22e30f9a
    Content-Disposition: form-data; name="field.min_length"

    aaaaaa
    -----------------------------7d513d22e30f9a
    Content-Disposition: form-data; name="field.max_length"

    a
    -----------------------------7d513d22e30f9a
    Content-Disposition: form-data; name="field.min_max"

    aaaaaa
    -----------------------------7d513d22e30f9a
    Content-Disposition: form-data; name="UPDATE_SUBMIT"

    Add
    -----------------------------7d513d22e30f9a
    Content-Disposition: form-data; name="add_input_name"

    demo
    -----------------------------7d513d22e30f9a--
    """)
Differences (ndiff with -expected +actual):
      HTTP/1.1 303 See Other
      Content-Length: 6811
      Content-Type: text/html;charset=utf-8
      Location: http://localhost/widgets/@@contents.html
    + <BLANKLINE>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    + <BLANKLINE>
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
            lang="en">
    + <BLANKLINE>
    +   <head>
    +     <title>Z3: +</title>
    + <BLANKLINE>
          <style type="text/css" media="all">@import
url(http://localhost/@@/zope3.css);</style>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    +     <meta http-equiv="Content-Type" content="text/html;charset=utf-8"
/>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    +     <!-- Basic zope3 javascript's -->
    +     <script type="text/javascript"
    +             src="http://localhost/@@/zope3.js">
    +     </script>
    + <BLANKLINE>
    + <BLANKLINE>
    +     <!-- Ugly is better than lobotomized. -->
    +     <script type="text/javascript"
    +             src="http://localhost/@@/xmltree.js">
    +     </script>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    +     <link rel="icon" type="image/png"
    +           href="http://localhost/@@/favicon.png" />
    +   </head>
    + <BLANKLINE>
    +   <body onload="loadtree('http://localhost/',
'http://localhost/widgets/+/'); ">
    + <BLANKLINE>
    + <BLANKLINE>
    +     <div id="global">
    +       <div id="userDetails">
    + <BLANKLINE>
    +           User:
    +           Manager
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    +           <a
href="@@logout.html?nextURL=http%3A//localhost/widgets/%2B/addDemoTextWidget
.html">[Logout]</a>
    + <BLANKLINE>
    + <BLANKLINE>
    +       </div>
    + <BLANKLINE>
    +         <a href="http://localhost/@@SelectedManagementView.html"
    +            name="top"><img src="http://localhost/@@/zope3logo.gif"
/></a>
    + <BLANKLINE>
    +     </div>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    +     <div id="navigators">
    + <BLANKLINE>
    +       <!-- Navigation tree box -->
    + <BLANKLINE>
    +     <!-- Ugly is better than lobotomized. -->
    +       <div class="box" id="navigationTree">
    +         <h4>Navigation</h4>
    +         <div xmlns="http://www.zope.org/zope3xmltree"
    +              id="navtreecontents" class="body"
    +              onclick="treeclicked(event);">Loading...</div>
    +       </div>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    +     </div>
    + <BLANKLINE>
    + <BLANKLINE>
    +     <div id="workspace">
    + <BLANKLINE>
    + <BLANKLINE>
    +       <div id="breadcrumbs">
    +         Location:&nbsp;<a
href="http://localhost/@@SelectedManagementView.html">[top]</a>
    +            /
    +           <a
href="http://localhost/widgets/@@SelectedManagementView.html">widgets</a> /
    +           <a
href="http://localhost/widgets/+/@@SelectedManagementView.html">+</a> /
    +       </div>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    +       <!-- OnlineHelp with popup support -->
    +       <!-- note, we reverse the actions list 'cos they're packed to
the
    +            screen from the right -->
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    +       <div id="viewspace">
    + <BLANKLINE>
    +         <div id="message">
    +         </div>
    + <BLANKLINE>
    +         <div id="content">
    +           <div>
    + <BLANKLINE>
    +   <div>
    + <BLANKLINE>
    +     <form action="http://localhost/widgets/+/addDemoTextWidget.html"
    +           method="post" enctype="multipart/form-data">
    + <BLANKLINE>
    +       <div>
    + <BLANKLINE>
    +         <h3>Add a Demo TextWidget</h3>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
            <div class="row">
    + <BLANKLINE>
                <div class="label">
                  <label for="field.standard"
                         title="zope.schema.TextLine field with only title
and description.">standard</label>
                </div>
                <div class="field"><input class="textType"
id="field.standard" name="field.standard" size="20" type="text"
value="demotext"  /></div>
    + <BLANKLINE>
    + <BLANKLINE>
            </div>
            <div class="row">
    + <BLANKLINE>
                <div class="label">
                  <label for="field.required"
                         title="zope.schema.TextLine field with required =
True.">required</label>
                </div>
                <div class="field"><input class="textType"
id="field.required" name="field.required" size="20" type="text"
value="demotext"  /></div>
    + <BLANKLINE>
    + <BLANKLINE>
            </div>
            <div class="row">
    + <BLANKLINE>
                <div class="label">
                  <label for="field.constraint"
                         title="zope.schema.TextLine field with constraint =
lambda x: x == u'constraint'.">constraint</label>
                </div>
                <div class="field"><input class="textType"
id="field.constraint" name="field.constraint" size="20" type="text"
value="constraint"  /></div>
    + <BLANKLINE>
    + <BLANKLINE>
            </div>
            <div class="row">
    + <BLANKLINE>
                <div class="label">
                  <label for="field.default"
                         title="zope.schema.TextLine field with default =
u'default'.">default</label>
                </div>
                <div class="field"><input class="textType"
id="field.default" name="field.default" size="20" type="text"
value="default"  /></div>
    + <BLANKLINE>
    + <BLANKLINE>
            </div>
            <div class="row">
    + <BLANKLINE>
                <div class="label">
                  <label for="field.min_length"
                         title="zope.schema.TextLine field with min_length =
5.">min_length</label>
                </div>
                <div class="field"><input class="textType"
id="field.min_length" name="field.min_length" size="20" type="text"
value="aaaaaa"  /></div>
    + <BLANKLINE>
    + <BLANKLINE>
            </div>
            <div class="row">
    + <BLANKLINE>
                <div class="label">
                  <label for="field.max_length"
                         title="zope.schema.TextLine field with max_length =
10">max_length</label>
                </div>
                <div class="field"><input class="textType"
id="field.max_length" name="field.max_length" size="20" type="text"
value="a"  /></div>
    + <BLANKLINE>
    + <BLANKLINE>
            </div>
            <div class="row">
    + <BLANKLINE>
                <div class="label">
                  <label for="field.min_max"
                         title="zope.schema.TextLine field with min_lenght =
5 and max_length = 10">min_max</label>
                </div>
                <div class="field"><input class="textType"
id="field.min_max" name="field.min_max" size="20" type="text" value="aaaaaa"
/></div>
    + <BLANKLINE>
    + <BLANKLINE>
    +       </div>
    + <BLANKLINE>
    + <BLANKLINE>
    +         <div class="separator"></div>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    +         <div class="separator"></div>
    + <BLANKLINE>
    +       </div>
    +       <br /><br />
    +       <div class="row">
    +         <div class="controls"><hr />
    +           <input type="submit" value="Refresh" />
    +           <input type="submit" value="Add"
    +                  name="UPDATE_SUBMIT" />
    + <BLANKLINE>
    +                &nbsp;&nbsp;<b>Object Name</b>&nbsp;&nbsp;
    +               <input type="text" name="add_input_name"
    +                      value="demo" />
    + <BLANKLINE>
    +         </div>
    +       </div>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    +       <div class="separator"></div>
    +     </form>
    +   </div>
    + <BLANKLINE>
    +   </div>
    +         </div>
    + <BLANKLINE>
    + <BLANKLINE>
    +         <div id="context_information">
    + <BLANKLINE>
    +           <div id="helpers">
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    +           </div>
    + <BLANKLINE>
    + <!--
    +           <div id="inspectors">
    + <BLANKLINE>
    +             <div class="box" id="metadata"
    +                 tal:define="view context/@@MetaDataBox|nothing"
    +                 tal:condition="view/strip|nothing">
    + <BLANKLINE>
    +               <h4 i18n:translate="">Metadata</h4>
    + <BLANKLINE>
    +               <div class="body">
    + <BLANKLINE>
    +                 <div class="content" tal:content="structure view">
    +                   Some metadata
    +                 </div>
    + <BLANKLINE>
    +               </div>
    +             </div>
    +           </div>
    + -->
    + <BLANKLINE>
    +         </div>
    + <BLANKLINE>
    +         <div class="spacer">
    +           &nbsp;
    +         </div>
    + <BLANKLINE>
    +       </div>
    +     </div>
    + <BLANKLINE>
    +     <div id="footer" />
    + <BLANKLINE>
    +     <div id="logger" />
    + <BLANKLINE>
    +   </body>
    + <BLANKLINE>
      </html>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>
    + <BLANKLINE>

Regards
Roger Ineichen
_____________________________
Projekt01 GmbH
www.projekt01.ch
Langackerstrasse 8
6330 Cham
phone     +41 (0)41 781 01 78
mobile    +41 (0)79 340 52 32
fax       +41 (0)41 781 00 78
email r.ineichen at projekt01.ch
_____________________________
END OF MESSAGE 



More information about the Zope3-dev mailing list